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/b1710e2e-ad4d-4503-afb8-73d992ff89ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.