0

I need to make such feature: when user clicks "edit" button, the Django should open admin page for editing this object. I have made something like this:

<a onclick="window.open('/admin/posts/post/{{post.pk}}/', 'newwindow', 'width=auto, height=auto'); return false;">

And this will open window for editing this post. But when I click on "Save" button - object saves and nothing happens else. The window stays white...

But I need to close automatically window after "Save" button and refresh page from which user clicks "edit" button.

We can also see such window, when clicking on the icon "Change selected objectname", near foreign key in Django admin page.

Do you understand what I need? What should I do?

Thanks a lot.

Q-bart
  • 1,503
  • 4
  • 22
  • 41
  • It sounds like you should probably create your own edit page rather than using the Django admin one. Modifying the Django admin templates to do this is probably not a good idea. – themanatuf Mar 07 '16 at 17:05
  • But I think, that when Django has such edit page, then I can override it in some way... But I don`t know in what way... – Q-bart Mar 07 '16 at 17:49
  • http://stackoverflow.com/questions/6583877/how-to-override-and-extend-basic-django-admin-templates – themanatuf Mar 07 '16 at 17:54
  • https://code.djangoproject.com/wiki/ExtendingAdminTemplates – themanatuf Mar 07 '16 at 17:54

0 Answers0