For a django model, how can I get the django admin URL to add another, or list objects, etc.?

http://docs.djangoproject.com/en/dev/ref/contrib/admin/#reversing-admin-urls

obj = coconut_transportation.swallow.objects.all()[34]

# list url
url = reverse("admin:coconut_transportation_swallow_changelist")

# change url
url = reverse("admin:coconut_transportation_swallow_change", args=[obj.id])

# add url
url = reverse("admin:coconut_transportation_swallow_add")

Leave a Comment