[Django]-How to correctly load data from a table to a form?

0👍

You could change your that ChoiceField to a ModelChoiceField

     location = forms.ModelChoiceField(queryset=LocationItem.objects.all().order_by('room__name')

Here’s some documentation that might help: https://docs.djangoproject.com/en/1.6/ref/forms/fields/#modelchoicefield

Leave a comment