10👍
AuthorFormSet(queryset=Author.objects.all())
https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#changing-the-queryset
5👍
I have used it as follows the formset used is inlineformset_factory.
q = Projects.objects.get(pk=project)
formset = PayFormSet(prefix='payment',instance=q)
and then pass the formset to the template
- AttributeError: 'str' object has no attribute 'regex' django 1.9
- How to cache a model method in django?
Source:stackexchange.com