Hello,

I've an object that has three associations that should be edited inline. 
I would like to let the user create this object and it's associations at 
one page. Same goes for editing the object.

I've hacked something together using formsets, but I'm facing some 
problems. First of all, the code for the create and edit views is quite 
the same, but different at some points, which doesn't look really DRY to me.

The create view is done by using normal formsets if there is no data, 
and using inline formsets if there is data submited and there is an 
instance of the main object created (in other words: when the 
object_form is valid and saved with commit=False). It works, but is this 
the right way to handle object creation?

The edit view renders the data of a saved object and its inline formsets 
well, but gives an exception on saving the model. Even though the 
ModelForm was found valid.

Does someone have some tips or a snipped which does the above things 
(object creation/editing with one or more formsets)?

Bram

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

Reply via email to