On Tue, 2006-06-13 at 16:56 +0400, Grigory Fateyev wrote:
> Hello!
> 
> We have compositely app 'Address' with lots of classes. Like: Region,
> Country, Location and etc. And to fill the only address users need to
> click some forms to add one address. It's awfully ;(
> 
> Is it possible to write (Add|Change)Manipulator to commit data from some
> forms at that time? To write form with fields from any class and commit
> data using only one click?

Create your form to collect the data you need. Make the submit button on
that form send you to a view method to handle the submission as per
normal (see [1]). Then, write a custom manipulator and use it in your
form processing function as described in [2]. 

In that example, where it says "# Send e-mail using new data here...",
you would use the Python database API [3] and the data you now have from
your form to create your new objects and save them. If your various
models are inter-related via ManyToManyField and ForeignKey attributes,
you will also want to have a look at the section called "Related
objects" in the database API docs to see how to link them together.

[1] http://www.djangoproject.com/documentation/forms/ 

[2]
http://www.djangoproject.com/documentation/forms/#custom-forms-and-manipulators

[3] http://www.djangoproject.com/documentation/db_api/#creating-objects 

Regards,
Malcolm


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

Reply via email to