Complex form in modelform

19 views
Skip to first unread message

Arnab Banerji

unread,
Oct 19, 2015, 4:56:18 PM10/19/15
to Django users
Hi - I am trying to create a form from a model, say M with the following:

(1) a certain field FOO is a text field which would be constructed in views.py by concatenating a dynamic set of rows (so I need a jQuery plugin for that).

(2) multiple images can be tied to the model M, and I have a ForeignKey in the image model that maps to M - I need a jQuery plugin for that too so that users can add images dynamically.

(3) If a user gave a name already in use, the form goes into "edit" mode for the already existing model (modelchoiceform with validation to the rescue?)

Any good examples of the above scenarios? Or a form handling API?

Thanks a ton!
-AB

Collin Anderson

unread,
Oct 24, 2015, 1:36:48 PM10/24/15
to Django users
Hi,

For starters, here's an example of a formset for multiple images:

Collin
Reply all
Reply to author
Forward
0 new messages