Tuesday, 6 August 2013

Django admin app model url for list

Django admin app model url for list

Hi I have a simple model like so:
class Item(models.Model):
category = models.ForeignKey(Category)
system = models.ForeignKey(System)
company = models.ForeignKey(Company)
catalog_number = models.CharField(max_length=55)
name = models.CharField(max_length=255)
def __unicode__(self):
return self.name
I am doing some customization of the admin and I'm trying to access the
admin url for the list of of objects in this model. For example:
localhost:8000/admin/my_app/item/
I have consulted the documentation:
https://django.readthedocs.org/en/1.5.x/ref/contrib/admin/index.html#reversing-admin-urls
Which demonstartes a number of url paths for adding, changing etc, but not
for the list itself. For example, this gets me to the add object page:
href="{% url 'admin:my_app_item_add' %}
I have tried:
href="{% url 'admin:my_app_item_list' %}
but no joy.
Any help much appreciated.

No comments:

Post a Comment