Opened 7 years ago

Closed 4 years ago

#6417 closed New feature (duplicate)

Small change in generic realtions

Reported by: Adrian <aribao@…> Owned by: nobody
Component: contrib.contenttypes Version: master
Severity: Normal Keywords:
Cc: aribao@… Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I've modified the class model ContentType in /django/contrib/contenttypes/models.py to return:

return ('%s - %s') % ( self.app_label, self.name )

in order to make easy to use generic relations in the admin. If you had a model with the same name across different applications, it was impossible to know the exact reference in the select.

Attachments (1)

models.py.diff (519 bytes) - added by Adrian <aribao@…> 7 years ago.

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by Adrian <aribao@…>

comment:1 Changed 7 years ago by SmileyChris

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

I think this is fair enough, yes?

Adrian - try to stick to PEP8 formatting:

return '%s - %s' % (self.app_label, self.name)
#instead of:
return ('%s - %s') % ( self.app_label, self.name )

comment:2 Changed 4 years ago by gabrielhurley

  • Component changed from Contrib apps to contrib.contenttypes

comment:3 Changed 4 years ago by julien

  • Type set to New feature

comment:4 Changed 4 years ago by julien

  • Severity set to Normal

comment:5 Changed 4 years ago by Alex

  • Easy pickings unset
  • Resolution set to duplicate
  • Status changed from new to closed
  • UI/UX unset

Closing as a dupe of #16027 because Julien accepted that one, and it has a more recent patch/discussion.

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