Tuesday, March 29, 2011

Accessing values in formset loops

I am looping through a formset and attempting to add an additional
field to the form that is a multi select checkbox that has a value of
the ID of the current iteration of the formset loop.

So:

model1:
name = CharField
ID = IntegerField
FK = ForeignKey('model2')

model2:
name


my formset is set up to present all objects related to model2. I would
like to add a field in the form that is a checkbox that passes the ID
of model1 on POST.

Any clue how this can be accomplished?

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

No comments:

Post a Comment