Hi All
Ive overcome it by adding doing this:
def __init__(self, *args, **kwargs):
super(UniversityForm, self).__init__(*args, **kwargs)
self.fields['name'].choices = University.objects.values_list('id', 'name')
This makes sense. Don't reference objects that will be parsed before they
e
Hi
I have the following scenario in my forms.py:
UNIVERSITY_CHOICES = University.objects.values_list('id', 'name')
class UniversityForm(forms.Form):
name = forms.CharField(widget=forms.Select(attrs={"class":
"selectpicker", "data-live-search": "true","title": "find
university..."},choices=UN
2 matches
Mail list logo