update_object generic view doesn't see model's get_absolute_url

4 views
Skip to first unread message

David

unread,
Jul 30, 2010, 6:01:04 PM7/30/10
to Django users
I am using the generic view
django.views.generic.create_update.update_object to edit a model. The
form is displayed, the model gets updated, but on redirect, I get an
ImproperlyConfigured exception. Django tells me I need to define a
get_absolute_url method, but I already did, it just doesn't seem to be
seeing it. What's going on here?

David

unread,
Jul 30, 2010, 6:20:41 PM7/30/10
to Django users
Solved.

I used Django's traces to discover that the object wasn't being passed
to the view on POST. Inserting some exceptions in different places in
the source, I found that it was at the point the form was saved that
the model reference was lost. Looking at the form I realized I wasn't
returning the object after saving it in the save method.

It figures that as soon as I decide to give up and ask the question I
find the answer 5 minutes later.
Reply all
Reply to author
Forward
0 new messages