<davidwills@adviserbreakthrough.co.uk> wrote:
> Thank you both for your replies.
>
> Having created a modelform and used:
>
> ArticleFormSet = formset_factory(ArticleForm, extra=2)
>
> I have a queryset that produces the objects I want to edit in my formset.
> How can I bind these objects to the formset and therefore remove the need
> for the extra=2 parameter?
>
Use modelformset_factory instead. The FormSet class produced as a
result will accept a queryset argument, which will be used to work out
which objects are to be edited.
See:
https://docs.djangoproject.com/en/1.4/topics/forms/modelforms/#model-formsets
Cheers
Tom
--
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