Admin problem launching a non-Admin page

27 views
Skip to first unread message

Mike Dewhirst

unread,
Jan 15, 2019, 4:02:30 AM1/15/19
to Django users
I'm studying the Admin docs trying to figure out how to launch a
non-Admin page when required.

Django 1.11 and Pythons 2.7/3.6

The parts which look promising are ...
[1]    ModelAdmin.response_add()
[2] ModelAdmin.response_change()
[3]    ModelAdmin.add_view()
[4]    ModelAdmin.change_view()
and
[5]    admin.ModelAdmin.form

The use-case is ...after saving, detect whether a token (from a payment
gateway) exists in a subscription record and if not, launch a non-Admin
Django page/form to interface with the payment gateway.

I have tried unsuccessfully to launch any of a form, view or template
from the model save() method.

Has anyone had a similar Admin use-case and found a good way of tackling it?

Thanks for any suggestions

Mike

[1]
https://docs.djangoproject.com/en/1.11/ref/contrib/admin/#django.contrib.admin.ModelAdmin.response_add
[2]
https://docs.djangoproject.com/en/1.11/ref/contrib/admin/#django.contrib.admin.ModelAdmin.response_change
[3]
https://docs.djangoproject.com/en/1.11/ref/contrib/admin/#django.contrib.admin.ModelAdmin.add_view
[4]
https://docs.djangoproject.com/en/1.11/ref/contrib/admin/#django.contrib.admin.ModelAdmin.change_view
[5]
https://docs.djangoproject.com/en/1.11/ref/contrib/admin/#adding-custom-validation-to-the-admin

Derek

unread,
Jan 16, 2019, 12:39:25 AM1/16/19
to Django users
Hi Mike

Normally I have just used the functionality in a third-party admin "wrapper", for example, Django Suit  (https://django-suit.readthedocs.io/en/develop/configuration.html#id1).

I see others such as Jet (https://jet.readthedocs.io/en/latest/dashboard_custom_module.html) allow you to do the same.

Maybe you can get some ideas from them?  Basically you can create your own view and use that to display data in a template that inherits from, for example, the Django admin form template. A bit tricky first time but then it seems straightforward.

Derek

Mike Dewhirst

unread,
Jan 16, 2019, 2:37:40 AM1/16/19
to django...@googlegroups.com
Many thanks Derek - I have started reading ...

Mike
> <https://docs.djangoproject.com/en/1.11/ref/contrib/admin/#adding-custom-validation-to-the-admin>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users...@googlegroups.com
> <mailto:django-users...@googlegroups.com>.
> To post to this group, send email to django...@googlegroups.com
> <mailto:django...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9648a8b7-994d-41fe-9d3e-77f83f61c600%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/9648a8b7-994d-41fe-9d3e-77f83f61c600%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages