How to hide the 'empty entry' value in forms relating as ForeignKey?

51 views
Skip to first unread message

inoyon artlover KLANGRAUSCH

unread,
Dec 7, 2014, 1:57:12 PM12/7/14
to django...@googlegroups.com
Hi there, I got a form:

class Answers(models.ModelForm):

    psyq11 = forms.ModelChoiceField(
            queryset=PsychologicQuestion11.objects.all(),
           widget=forms.RadioSelect)


    psyq12 = forms.ModelChoiceField(
            queryset=PsychologicQuestion12.objects.all(),
            widget=forms.RadioSelect)

etc. etc....

The widget shows the '-------' entry.. I don't want it. Is there a way to solve it?
Also I would like to split the form into four areas in the template... is it possible?

Best regards, cheers :)

inoyon artlover KLANGRAUSCH

unread,
Dec 8, 2014, 3:09:51 PM12/8/14
to django...@googlegroups.com
just set 'initial=False' within the form-field works!
Reply all
Reply to author
Forward
0 new messages