0

I have a third party app in my proyect and I want to add one model class and some nctionality in the admin page.

In particular, I started using django-push-notifications to send push notifications to users. The problems are:

  1. Admin app doesn't come with a button to send notifications.
  2. The models and the views doesn't contemplate the option to send push notifications using the admin page.

I solved the first problem overriding the app_index.html template of the app. No problem here.

Just add an <ul> tag inside <code>content</code> block

The problem is when I try to add functionality to that button. I need that when the button is pressed, it shows a modal like this one where I can enter things that are not in the original model.

This is what I want to achieve when I press the "**SEND PUSH**" button

For example, it would be useful to have a model class "Notification" with fields like title, body, image, icon, a dropdown list of topics, etc. Then, when I press the button "SEND PUSH" in the admin page, a pop up is displayed with a form to enter those fields. And finally, when I want to send the notifications, a view (I guess...) receive these values and send the notifications (in this way or this way).

Any suggestions?

fferrin
  • 888
  • 2
  • 12
  • 29
  • Duplicate of [Where do I modify the admin view code for a 3rd party app?](https://stackoverflow.com/questions/9321955/where-do-i-modify-the-admin-view-code-for-a-3rd-party-app). See also https://stackoverflow.com/questions/8432174/django-modifying-extending-3rd-party-apps – solarissmoke Oct 28 '17 at 05:41
  • Duplicated? I already saw that answer, but I'm saying that I don't want to override a model. I need to create a new one without create another app, like `push_notifications_2` or something like that. The answer doesn't say either how can I display a popup from a custom button and where do I have to put the form to fill the notification and the code to send it. It's definitely not a duplicate question. – fferrin Oct 28 '17 at 14:48

0 Answers0