[Django] #32085: Add template tag for creating link to admin site

6 views
Skip to first unread message

Django

unread,
Oct 8, 2020, 3:57:06 AM10/8/20
to django-...@googlegroups.com
#32085: Add template tag for creating link to admin site
-------------------------------------+-------------------------------------
Reporter: Dart | Owner: nobody
Type: New | Status: new
feature |
Component: Template | Version: 3.1
system |
Severity: Normal | Keywords: Tags, Admin, Urls
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Hey! In some situations during development django apps, i need some way to
create link into django admin for changing, deleting specific model
instance.
Looking into of souces django you can see, that django has prefix names
for dynamic models. For more look at get_urls() method from ModelAdmin.
Example:
info = self.model._meta.app_label, self.model._meta.model_name
url = path('add/', wrap(self.add_view), name='%s_%s_add' % info)
I am propose to write template tag which accept any model instance and
action (update, delete, etc) and return correct url for django admin site.
Maybe this situation is too rare, its need some discussion.
Regards, Viktor Lomakin

--
Ticket URL: <https://code.djangoproject.com/ticket/32085>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 8, 2020, 5:11:26 AM10/8/20
to django-...@googlegroups.com
#32085: Add template tag for creating link to admin site
-----------------------------------+--------------------------------------
Reporter: Dart | Owner: nobody
Type: New feature | Status: closed
Component: Template system | Version: 3.1
Severity: Normal | Resolution: invalid
Keywords: Tags, Admin, Urls | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------

Comment (by Dart):

Thanks!

--
Ticket URL: <https://code.djangoproject.com/ticket/32085#comment:2>

Reply all
Reply to author
Forward
0 new messages