How to create on one page multiple form with instance of each model object. I have already created object of salon. And i need to render form with instance of all objects on one page.
forms.py
class SalonForm(forms.ModelForm):
class Meta:
model = Salon
fields = ('some_fields')
views.py
def salon_list(request):
salons_list = Salon.objects.all()
form = SalonForm()
ctx = {
'salons': salons,
'form': form,
}
return render(request, 'template/list.html', ctx)
list.html
{% for salon in salons %}
{{ salon }}
{{ form }}
{% endfor %}