Wednesday, May 2, 2012

ListView, Formsets and Model formsets

I'm sure I'm missing something obvious here...

I want to produce a form which is a list of objects in my model, with
a checkbox to select some of the objects, so that the posted data is
the list of selected objects. Just like you get on the listviews in
the admin interface, in fact.

It seems like formsets are the solution here, but neither Formset nor
ModelFormset seems to be quite right: I want a reference to my
original model, so that each form in the set is related to an object,
but I don't want *any* of the model's fields in the form - just the
checkbox. Nor do I want a database table with ForeignKeyField/
BooleanField columns - this is just transitory.

I'm sure this should be trivial, if I just squint at it right.

Thanks,

steve

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


Real Estate