Opened 17 years ago

Closed 13 years ago

#6417 closed New feature (duplicate)

Small change in generic realtions

Reported by: Adrian <aribao@…> Owned by: nobody
Component: contrib.contenttypes Version: dev
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@…> 17 years ago.

Download all attachments as: .zip

Change History (6)

by Adrian <aribao@…>, 17 years ago

Attachment: models.py.diff added

comment:1 by Chris Beaven, 17 years ago

Triage Stage: UnreviewedDesign 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 by Gabriel Hurley, 14 years ago

Component: Contrib appscontrib.contenttypes

comment:3 by Julien Phalip, 14 years ago

Type: New feature

comment:4 by Julien Phalip, 13 years ago

Severity: Normal

comment:5 by Alex Gaynor, 13 years ago

Easy pickings: unset
Resolution: duplicate
Status: newclosed
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