Code

Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#11137 closed (fixed)

Typo in Proxy Model documentation (topics/db/models)

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

Description

The documentation for proxy models in [source:django/trunk/docs/topics/db/models.txt docs/topics/db/models.txt] is inconsistent with [source:django/trunk/docs/topics/db/managers.txt docs/topics/db/managers.txt]. The models documentation is missing the declaration of django.db.models.Models for it's example class ExtraManagers.

[source:django/trunk/docs/topics/db/models.txt#10797 r10797]

# Create an abstract class for the new manager.
class ExtraManagers:
    secondary = NewManager()

    class Meta:
        abstract = True

class MyUser(User, ExtraManagers):
    class Meta:
        proxy = True

Proposed:

# Create an abstract class for the new manager.
class ExtraManagers(models.Model):
    secondary = NewManager()

    class Meta:
        abstract = True

class MyUser(User, ExtraManagers):
    class Meta:
        proxy = True

Attachments (1)

proxy-model.patch (470 bytes) - added by ekarulf 5 years ago.
Proposed solution

Download all attachments as: .zip

Change History (4)

Changed 5 years ago by ekarulf

Proposed solution

comment:1 Changed 5 years ago by Alex

  • milestone set to 1.1
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:2 Changed 5 years ago by kmtracey

  • Resolution set to fixed
  • Status changed from new to closed

(In [10818]) Fixed #11137 -- Add missing base class in proxy model extra managers doc. Thanks ekarulf.

comment:3 Changed 3 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.