I am not fully tracking to the problem here, but when it comes to
overriding save() behavior on forms, I find the following helper to be
handy:

def build_instance_from_form(model_form):
    instance = model_form.save(commit=False)
    return instance

Then in your view code do something like this:

   restaurant = build_instance_from_form(form)
   # fix up data like city
   restaurant.save()

This can help you avoid all the complexity of overriding save() on the
form object and delegating to super(), etc., at least in some cases.

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


Reply via email to