Lets take the standard example
class Author(models.Model):
name = models.CharField(max_length=100)
class Book(models.Model):
title = models.CharField(max_length=100)
author = models.ForeignKey(Author)
#... Many other fields ...
From the admin change template of Author trying to access to the related books
<ul>
{% for book in original.book_set.all %}
<li>
<a href="{% url admin:myapp_manager_change book.id %}">Edit {{ book }}</a>
</li>
{% endfor %}
</ul>
I get
Caught NoReverseMatch while rendering: Reverse for ‘myapp_manager_change’ with arguments ‘(1L,)’ and keyword arguments ‘{}’ not found.
Why ?
And how can I access this book_set ?
Check the docs on reversing admin urls.
You have to replace “myapp” with your actual app:
So if your app is named library and your model’s name is book the link would be: