3π
β
βAt first, I thought this was what formsets were for, but I canβt see any way to automatically iterate over the contents of a database table to produce items to go in the form, if you see what I mean.β
You need to get a queryset. And you need to provide that queryset to your form as initial data. See using initial data with a formset for the code.
initial = [ list of { dictionaries }, one per form ]
Interestingly, this is a direct feature of the model API through the values
method of a queryset.
π€S.Lott
0π
I have found my answer, using modelformset_factory instead formset_factory solves the problem, Thanksβ¦
π€juanefren
- [Django]-Subversion doesn't see my updates via python script
- [Django]-How is "secret_key.txt" more secure in Django project?
Source:stackexchange.com