﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
10124	ModelForm documentation horribly unclear for foreign key models	ColinAlston	nobody	"The only way I found this out was by swearing profusely in #django. *Please* document it.

The current documentation rather tenuously approaches the subject with the whole Author thing which is just too simplistic to demonstrate the usage. 

{{{

# -- Model --
class Colour(models.Model):
    colour_name = models.CharField(max_length=200)

class Fruit(models.Model):
    fruit_name = models.CharField(max_length=200)
    fruit_colour = models.ForeignKey(Colour, blank=True, null=True)

# -- View -- 
class AddFruitForm(forms.ModelForm):
    class Meta: 
        model = Fruit

    fruit_colour = forms.ModelChoiceField(queryset=Colour.objects.order_by('colour_name'))
}}}"	Uncategorized	closed	Documentation	1.0	Normal	invalid	ModelForm		Unreviewed	0	0	0	0	0	0
