Hello all,

I've been playing around with the newforms library and I'd like to
check that I'm on the right track.

I've got a fairly complicated model that has a few foreign keys and
m2m fields. One of the m2m fields references a table with ~130,000
rows so the usual select boxes aren't that usable. I've created a form
which simplifies the entry but I would like to check the preferred way
of doing certain things.

1. Additional validation - One field is a RegexField but I would like
to add extra validation. At the moment I've subclassed it and added my
own 'clean' method.

2. Saving the model - I've implemented a save method in the form which
will return an instance of the model in a similar fashion to
form_for_model. Is this good practice or should I create the instance
in my view and populate it from the form?

3. Binding data - I'd like the form to handle editing of an instance.
I could construct a dictionary of values and pass it to the form as
per the docs but I'd like to just pass a model instance and have the
form sort things out. Is this advisable? If so then does anyone have
any pointers about what methods I need to implement?

Thanks in advance for any pointers.

Felix

P.S. Are there any thoughts about form inheritance? I'd like to be
able to create a form base on another but with some more fields. At
the moment this doesn't seem to work as expected...

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