Opened 16 years ago

Closed 11 years ago

#8270 closed New feature (fixed)

Add convenience method to ContentTypeManager

Reported by: Jeremy Dunck Owned by: nobody
Component: contrib.contenttypes Version: dev
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 Jeremy Dunck 16 years ago.
Adds get_for_app_label_and_model_name to ContentTypeManager. Obviously a terrible name.

Download all attachments as: .zip

Change History (10)

by Jeremy Dunck, 16 years ago

Attachment: contenttype-label.diff added

Adds get_for_app_label_and_model_name to ContentTypeManager. Obviously a terrible name.

comment:1 by Jeremy Dunck, 16 years ago

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

comment:2 by Jacob, 16 years ago

milestone: post-1.0
Triage Stage: UnreviewedAccepted

comment:3 by Jacob, 16 years ago

milestone: post-1.0

comment:4 by (none), 16 years ago

milestone: post-1.0

Milestone post-1.0 deleted

comment:5 by Gabriel Hurley, 14 years ago

Component: Contrib appscontrib.contenttypes

comment:6 by Luke Plant, 14 years ago

Severity: Normal
Type: New feature

comment:7 by Aymeric Augustin, 13 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:8 by Aymeric Augustin, 13 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:9 by Aymeric Augustin, 11 years ago

Resolution: fixed
Status: newclosed

This feature was added as ContentTypeManager.get_by_natural_key.

It's a side effect of a large patch, 35cc439228cd32dfa7a3ec919db01a8a5cd17d33.

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