Opened 6 years ago

Closed 6 years ago

#13440 closed (duplicate)

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

Reported by: ccurvey 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 6 years ago by ccurvey

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

sorry, duplicate of #11864

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