On 2 March, Malcolm Tredinnick wrote:
> [...] Group B are those forms where the input data is then
> munged in some way and split across possibly multiple models for
> storage. An example here might be a form that allows multiple teams for
> a competition to be entered -- the data is split across multiple model
> instances for saving.
>
> I find in my own form creation, that I mostly create group B forms, so
> form_for_model() doesn't appear in my code very much. Instead, I am
> responsible for splitting up the data and populating the right models
> and then saving them.

In my app, I'm going to need several different views in which multiple
instances of the same model can be edited and inserted, very much like
edit_inline in the admin app.

Now, following the DRY principle, I'm wondering how to best share
common code among the forms, and whether someone already has created
tools (or even example code) for this.

I've figured that I probably should use the object primary key value
in the form prefix, and then pick them from request.POST to be fed
back into multiple form objects. Is this correct?


--~--~---------~--~----~------------~-------~--~----~
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