Code

Opened 6 years ago

Last modified 5 years ago

#8270 new New feature

Add convenience method to ContentTypeManager

Reported by: jdunck Owned by: nobody
Component: contrib.contenttypes Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: yes Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

app_label, model_name (e.g. ('news', 'story')) is often passed around internally in our codebase.

The attached patch would be nice in Django, since otherwise we do a little hula to get the ContentType object. Doing a direct query would miss the handy cache ContentTypeManager includes.

Attachments (1)

contenttype-label.diff (1.0 KB) - added by jdunck 6 years ago.
Adds get_for_app_label_and_model_name to ContentTypeManager. Obviously a terrible name.

Download all attachments as: .zip

Change History (9)

Changed 6 years ago by jdunck

Adds get_for_app_label_and_model_name to ContentTypeManager. Obviously a terrible name.

comment:1 Changed 6 years ago by jdunck

To be clear, in my report here, by "our codebase", I mean the codebase for pegasusnews.com, not Django itself.

comment:2 Changed 6 years ago by jacob

  • milestone post-1.0 deleted
  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 6 years ago by jacob

  • milestone set to post-1.0

comment:4 Changed 5 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

comment:5 Changed 3 years ago by gabrielhurley

  • Component changed from Contrib apps to contrib.contenttypes

comment:6 Changed 3 years ago by lukeplant

  • Severity set to Normal
  • Type set to New feature

comment:7 Changed 2 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:8 Changed 2 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as new
The owner will be changed from nobody to anonymous. Next status will be 'assigned'
as The resolution will be set. Next status will be 'closed'
Author


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

 
Note: See TracTickets for help on using tickets.