Opened 14 years ago

Closed 14 years ago

#13440 closed (duplicate)

in discussion of ForeignKey(), mention the reverse relationship that is created

Reported by: Chris Curvey Owned by: nobody
Component: Documentation Version: 1.2-beta
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

On this page: http://docs.djangoproject.com/en/dev/ref/models/fields/#foreignkey

Mention that creating a foreign key creates a backref as well. For example;

class Car(models.Model):
    manufacturer = models.ForeignKey('Manufacturer')
    # ...

class Manufacturer(models.Model):
    # ...

will silently create an attribute of manufacturer called "car_set" that contains a list of all the cars associated with that manufacturer.

Change History (1)

comment:1 by Chris Curvey, 14 years ago

Resolution: duplicate
Status: newclosed

sorry, duplicate of #11864

Note: See TracTickets for help on using tickets.
Back to Top