#10124 closed Uncategorized (invalid)
ModelForm documentation horribly unclear for foreign key models
| Reported by: | ColinAlston | Owned by: | nobody | 
|---|---|---|---|
| Component: | Documentation | Version: | 1.0 | 
| Severity: | Normal | Keywords: | ModelForm | 
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no | 
| Needs tests: | no | Patch needs improvement: | no | 
| Easy pickings: | no | UI/UX: | no | 
Description
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'))
      Change History (4)
comment:1 by , 17 years ago
comment:3 by , 17 years ago
| Resolution: | → invalid | 
|---|---|
| Status: | new → closed | 
comment:4 by , 13 years ago
| Easy pickings: | unset | 
|---|---|
| Severity: | → Normal | 
| Type: | → Uncategorized | 
| UI/UX: | unset | 
And even four years later, no development in the documents regarding this issue! Just wasted an enormous amount of time!
  Note:
 See   TracTickets
 for help on using tickets.
    
This ticket doesn't actually explain any problem with the documentation, or what the solution to the problem was; it's just a code sample. Please provide an explanation of: