Opened 8 years ago

Closed 8 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:


On this page:

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 Changed 8 years ago by Chris Curvey

Resolution: duplicate
Status: newclosed

sorry, duplicate of #11864

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