On Tuesday, October 16, 2012, Lachlan Musicman wrote:

> Hola,
>
> I wanted to override the save event in the admin so that users were
> redirected to a different page.
>
> I found this page describing how to do it:
>
> http://www.ibm.com/developerworks/opensource/library/os-django-admin/index.html#listing10
>
> It recommends two methods and describes one:
>
> "There are two ways to change the behavior of the Save button: You can
> override admin.ModelAdmin.response_add, which is responsible for the
> actual redirection after a save, or you can override
> admin.ModelAdmin.change_view. The latter is somewhat simple"
>
This method throws error:

You called this URL via POST, but the URL doesn't end in a slash and you
have APPEND_SLASH set. Django can't redirect to the slash URL while
maintaining POST data. Change your form to point to
127.0.0.1:8000/admin/tafe/applicant/4/None/ (note the trailing slash), or
set APPEND_SLASH=False in your Django settings.

Gah. Do I bother trying to work out why it's redirecting to
127.0.0.1:8000/admin/tafe/applicant/4/None/ instead of where I want it to
or rethink completely?

cheers
L.


-- 
...we look at the present day through a rear-view mirror. This is something
Marshall McLuhan said back in the Sixties, when the world was in the grip
of authentic-seeming future narratives. He said, “We look at the present
through a rear-view mirror. We march backwards into the future.”

http://www.warrenellis.com/?p=14314

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to