1 2 3 4 5 6 7 8 9 | from django.db.models import permalink
@permalink
def get_admin_url(obj):
"Returns the URL to the object in the Django admin site."
from django.contrib.contenttypes.models import ContentType
content_type = ContentType.objects.get_for_model(obj)
return ('django.contrib.admin.views.main.change_stage',
[content_type.app_label, content_type.model, str(obj.pk)])
|
More like this
- Generic AJAX app by Rupe 3 years, 11 months ago
- Filter by taggit tags in the admin by flupke 1 year, 7 months ago
- Clean Reversion History: Remove unimportant Changes by guettli 1 year, 3 months ago
- Create short URL redirects for site urls. by matt.geek.nz 4 years, 3 months ago
- Send information mails to related staff members. by sleytr 5 years, 11 months ago
Comments