#13753: Generic views don't redirect to an URL name, like django.shortcuts.redirect does -------------------------------------------------------------+-------------- Reporter: Diederik van der Boor <vdb...@codingdomain.com> | Owner: nobody Status: new | Milestone: Component: Generic views | Version: 1.2 Keywords: redirect DRY | Stage: Unreviewed Has_patch: 0 | -------------------------------------------------------------+-------------- 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? -- Ticket URL: <http://code.djangoproject.com/ticket/13753> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.