Many thanks Derek - I have started reading ...
Mike
On 16/01/2019 4:39 pm, Derek wrote:
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
On Tuesday, 15 January 2019 11:02:30 UTC+2, Mike Dewhirst wrote:
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
<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
<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
<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
<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
<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+unsubscr...@googlegroups.com
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com
<mailto:django-users@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.
--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/81f1fe0a-7b9d-af95-8d31-ddc5b4d8414e%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.