dynamically adding form fields
I'm working on a complex form and not sure if there is an elegant way to handle it in django.
The form creates an invoice and it uses jQuery to dynamically add/remove extra form fields into the HTML for line items. Each line item contains several fields including description, unit price, quantity etc.
On the server I need to create all these line item objects and set the foreign key back to the invoice model object. It needs to validate everything and return errors for the appropriate fields.
I'd like to use a ModelForm or Form for the whole invoice but not sure how to represent the line item fields.
Suggestions?
Thanks
-- You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/xaYRsc5sZxwJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home