> I'm not sure what "a patch in the development tree" means here. Current
> subversion trunk doesn't seem to have anything like that.

Sorry for not being clear -- I'm (obviously) not familiar with the
mechanism of open source / django development.  What I was referring
to is the ticket you mentioned (4001) and the "patch" is the file
attached to that ticket (save_instance_m2m.patch).

> Remember that the situation where a form maps precisely onto a model is
> a very specialised case. In the general case, you need to build the
> objects you are going to save manually anyway (since one form provides
> information for many models). So the workaround that springs to mind in
> this case is to forget about using form_for_model() and just build the
> form by hand and construct the save objects in your view. It's only a
> few lines of code.

That sounds great (in fact, I was forced to combine two tables into
one in order to coerce the data into something that can be easily used
by form_for_model).  However, I'm not sure where to start to come to
grips with the concepts of "objects you are going to save", "build the
form by hand", and "construct the save objects".

I'm guessing that this means instantiating models, creating the form
bound to data from several different model classes, then (on POST)
instantiating new model instances, somehow unpacking the data from the
form into the appropriate model classes, and saving the instances.

If you can direct me to a simple example of a view that does this
(including a many-to-many field in one of the models if such a field
requires any special handling in the view) it would be greatly
appreciated.  I guess my three sticking points are 1) how to create a
form from _several_ objects, 2) how to create the form from several
_models_ when the user is trying to add new information and 3) how to
instantiate the multiple save objects from the POSTed form.

Many thanks for your kind assistance in what I know must be quite a
simple operation.
--
Larry Lustig


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
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