hi:

i just built a test app (with revision 645) using the 121 example found
at [http://www.djangoproject.com/documentation/models/one_to_one/] as i
am interested in using the 121 functionality in a project.

my model is an exact copy of the one in the docs - eg.
-----------------------------------------
class Place(meta.Model):
 name = meta.CharField(maxlength=50)
 address = meta.CharField(maxlength=80)

 def __repr__(self):
  return self.name

 class META:
  db_table="places"


class Restaurant(meta.Model):
 place = meta.OneToOneField(Place)
 serves_hot_dogs = meta.BooleanField()
 serves_pizza = meta.BooleanField()

 def __repr__(self):
  return self.get_place().name

 class META:
  db_table="restaurants"
  admin = meta.Admin()

-----------------------------------------
if i follow these steps in admin:
i. add a restaurant
ii. the ui gives you the option to add a place using the green '+' sign
next to the places dropdown.
iii. i add a place, which saves ok and redisplays in the dropdown
iv. i save a restaurant and get this error.

-----------------------------------------
D:\bin\dev\python\lib\site-packages\django\core\meta\__init__.py", line
1290, in _parse_lookup
    _throw_bad_kwarg_error(kwarg)


D:\bin\dev\python\lib\site-packages\django\core\meta\__init__.py", line
1181, in _throw_bad_kwarg_error
    raise TypeError, "got unexpected keyword argument '%s'" % kwarg

TypeError: got unexpected keyword argument place__pk'
------------------------------------------

i tried having a look at in winpdb but could not tell what was going on
if someone can give me an indication of what the problem is that would
be so lovely.

thanks
mark

Reply via email to