On Sat, 2007-12-29 at 00:55 -0800, Ulf Kronman wrote: > Hi all, > I'm using Django to build a repository of scientific publications at > my university. > > Now we need to edit publication records that have been supplied by our > departments and imported into the database. > > I would like to be able to use the excellent Django admin interface > for this editing, but my problem is that I would like my editors to be > able to start from a custom-made list of publications that need > editing and then return back to this custom list, after having edited > a record in the admin interface. > > The default behavior of the admin edit is to return the user to a > neutral listing of the type of records being edited. Is there a way to > change this behavior and make it return to another page, preferably > using some kind of dynamic referrer parameter?
The admin interface isn't really designed to be customised like that. Rather, the principle is that if you can edit one record, you can edit them all. However, a bit of reading of the source -- in particular, contrib.admin.views.main -- will reveal some approaches that could be used if you really wanted to. For example, the change_stage view (which, along with add_stage() is used to process a model submission) sends the user back to "../" upon success. So you could write a custom URLConf entry that overrides that URL (admin/<app_name>/<model>/) and presented them with the page you want to show them. That sort of thing requires a little bit of planning out, but I can say from exprience that it generally works out fairly well. There's a little bit of duplication, since you need to write a view that is almost, but not quite, exactly like the standard admin view. However, you can use the normal admin templates and everything. It takes a little bit of tiem to get this to work, but it's not impossible. Regards, Malcolm \ -- Atheism is a non-prophet organization. http://www.pointy-stick.com/blog/ --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---