Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#23282 closed Cleanup/optimization (fixed)

Change confusing text about "Inheritance and reverse relations"

Reported by: knowledgepoint-devs Owned by: nobody
Component: Documentation Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

https://docs.djangoproject.com/en/1.6/topics/db/models/#inheritance-and-reverse-relations says "If you are putting those types of relations on a subclass of another model".

I think it should read "If you are putting those types of relations on another subclass of the parent model"?

Attachments (1)

23282.diff (1.7 KB) - added by Tim Graham 2 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 2 years ago by Baptiste Mispelon

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization
Version: 1.4master

Even after reading it a few times, I still understand what the documentation is trying to tell me.

It also seems to me that the example chosen is wrong since the following models (taken straight from the documentation) validate fine on Django 1.6:

class Place(models.Model):
    name = models.CharField(max_length=50)
    address = models.CharField(max_length=80)

class Restaurant(Place):
    serves_hot_dogs = models.BooleanField()
    serves_pizza = models.BooleanField()

class Supplier(Place):
    # Notice the lack of a related_name
    customers = models.ManyToManyField(Restaurant)

Changed 2 years ago by Tim Graham

Attachment: 23282.diff added

comment:2 Changed 2 years ago by Tim Graham

Has patch: set

comment:3 Changed 2 years ago by Claude Paroz

Triage Stage: AcceptedReady for checkin

comment:4 Changed 2 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In 700618706425ae15888b9e60bdc7a00dd0b32a2f:

Fixed #23282 -- Corrected inheritance and reverse relations example.

Thanks knowledgepoint-devs for the report and claudep for review.

comment:5 Changed 2 years ago by Tim Graham <timograham@…>

In 20e3a004ac88b127a51bb332ca2653fe06a19a97:

[1.7.x] Fixed #23282 -- Corrected inheritance and reverse relations example.

Thanks knowledgepoint-devs for the report and claudep for review.

Backport of 7006187064 from master

comment:6 Changed 2 years ago by Tim Graham <timograham@…>

In d1e4fb996bd969c9a5d1dc4546b3fd46766ad25e:

[1.6.x] Fixed #23282 -- Corrected inheritance and reverse relations example.

Thanks knowledgepoint-devs for the report and claudep for review.

Backport of 7006187064 from master

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