﻿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
13753	Generic views don't redirect to an URL name, like django.shortcuts.redirect does	Diederik van der Boor <vdboor@…>	nobody	"I just noticed that the `post_save_redirect` parameter of generic views (`update_object`, and friend) doesn't have the same abilities as `django.shortcuts.redirect` (in fact, it reinvents the wheel).
When an URL name is passed, it will not do a lookup, but redirect to that given name.

----

The following does not work as expected:

{{{
def edit(request, item_id):
    return update_object(request, object_id=item_id, model=Context
                                  post_save_redirect='myapp-context-index')
}}}

It needs a manual resolve call:

{{{
from django.core import urlresolvers

def edit(request, item_id):
    return update_object(request, object_id=item_id, model=Context
                                  post_save_redirect=urlresolves.reverse('myapp-context-index'))   # manual resolving
}}}

Unlike the `django.shortcuts.redirect` function, which does allow the URL name to be used:

{{{
    return redirect(""myapp-context-index"")
}}}

----

In other words, could the generic view use `django.shortcuts.redirect` internally too?"		closed	Generic views	1.2		fixed	redirect DRY		Accepted	0	0	0	0	0	0
