Fair enough, this seems not to pick up steam - let it be then. For the record, the workaround is to add views to the admin site using a proxy model and a model admin class with custom changelist_view(), removing add, change and delete permissions so that only view permission remains. It will be listed in the admin index page with view-only icon đ, so the result is decent enough.
(Here's a detailed explanation: https://stackoverflow.com/a/54974566/258772 ). Note that django-admin-views is not compatible with Django 2.1. Best regards, Mart kolmapäev, 6. märts 2019 16:45.24 UTC+2 kirjutas Carlton Gibson: > > django-admin-views was functional as recently as Django 2.0 > https://github.com/frankwiles/django-admin-views/issues/34 > > I'm guessing it would be pretty easy to pick up. (Frank stated he was very > happy for someone to become steward...) > > (I appreciate that doesn't address the "should we have this in core?" > question.) > > On Wednesday, 6 March 2019 12:40:06 UTC+1, mrts wrote: >> >> Hello! >> >> Django ModelAdmin class has a nice way to create custom admin views with >> get_urls(). What is missing however is a way to expose them in the admin >> index page. >> >> Frank Wiles created the (now abandoned) django-admin-views package [1] as >> a workaround and there are many questions regarding this in StackOverflow >> [2][3][4][5]. >> >> What do you think about exposing custom views in admin index page via a >> new ModelAdmin.extra_views attribute? >> extra_views would be a list of dictionaries/objects with 'url' and 'name' >> fields. >> >> They would be visible in the index page with the following change to >> django/contrib/admin/templates/admin/index.html: >> >> --- >> ../venv/Lib/site-packages/django/contrib/admin/templates/admin/index.html >> 2019-02-28 01:22:12.767388100 +0200 >> +++ templates/admin/index.html 2019-03-06 12:57:22.070586600 +0200 >> @@ -43,6 +43,15 @@ >> <td> </td> >> {% endif %} >> </tr> >> + {% if model.extra_views %} >> + {% for view in model.extra_views %} >> + <tr> >> + <th scope="row"><a href="{{ view.url }}">{{ view.name >> }}</a></th> >> + <td> </td> >> + <td> </td> >> + </tr> >> + {% endfor %} >> + {% endif %} >> {% endfor %} >> </table> >> </div> >> >> Best regards, >> Mart >> >> --- >> >> [1] https://github.com/frankwiles/django-admin-views >> [2] >> https://stackoverflow.com/questions/37512818/how-to-add-custom-page-to-django-admin-with-custom-form-not-related-to-any-mode >> [3] >> https://stackoverflow.com/questions/53712723/add-a-link-to-custom-django-admin-view >> [4] >> https://stackoverflow.com/questions/5693519/django-custom-view-into-admin-page >> [5] >> https://stackoverflow.com/questions/49176113/make-new-custom-view-at-django-admin >> > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/660f18b4-1464-467c-b412-a80fc7150e68%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
