The generic view django.views.create_update.update_object requires the
object to have an id in line 99.

   manipulator = mod.ChangeManipulator(object.id)

Objects with OneToOneFields don't have an id attribute. Instead they
have something like "relatedobject_id" I'm not sure where this should
be fixed. In the generic view code (test for OneToOneField and do the
right thing(tm)" or if models with OneToOneField should actually have
an id (probably just return the "relatedobject_id"). Any preferences?
I can work on a patch. I'd much rather fix this than put workarounds
in my app code or write a custom view.

There is also another issue under the same circumstances.
mod.Klass._meta.pk.name returns "relatedobject" rather than
"relatedobject_id", and get_object("relatedobject__exact") results in
a KewordError... get_object("relatedobject__id__exact") works fine.
Unfortunately, the update_object view uses the former. I think the
model syntax changes broke some things where OneToOneFields are
involved.

Joseph

Reply via email to