Opened 16 years ago
Closed 16 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.
Note:
See TracTickets
for help on using tickets.
sorry, duplicate of #11864