﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
2756	[patch] allow get_object_or_404 and get_list_or_404 shortcuts to be passed Manager objects	Gary Wilson <gary.wilson@…>	Adrian Holovaty	"By allowing `get_object_or_404` and `get_list_or_404` to be passed `Manager` instances, you can use the shortcut with related models.  For example with the models:

{{{
#!python
class Author(models.Model):
    name = models.CharField(maxlength=50)

class Article(models.Model):
    author = models.ForeignKey(Author)
    title = models.CharField(maxlength=50)
}}}

you could do something like:
{{{
#!python
author = Author.objects.get(name=""Brave Sir Robin"")
article = get_object_or_404(author.article_set, title=""Run away!"")
articles = get_list_or_404(author.article_set, title__contains=""Camelot"")
}}}"	enhancement	closed	Core (Other)	dev	normal	fixed		gary.wilson@…	Unreviewed	1	0	0	0	0	0
