Opened 16 years ago
Closed 10 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)
Change History (10)
by , 16 years ago
Attachment: | contenttype-label.diff added |
---|
comment:1 by , 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 , 16 years ago
milestone: | post-1.0 |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:3 by , 16 years ago
milestone: | → post-1.0 |
---|
comment:5 by , 14 years ago
Component: | Contrib apps → contrib.contenttypes |
---|
comment:6 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → New feature |
comment:9 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
This feature was added as ContentTypeManager.get_by_natural_key
.
It's a side effect of a large patch, 35cc439228cd32dfa7a3ec919db01a8a5cd17d33.
Adds get_for_app_label_and_model_name to ContentTypeManager. Obviously a terrible name.