title: Access model properties in Django Admin templates?
body: <p>I have Django 2.0.3 on Python 3.5.3. I search for simple way to small improve my standard Django Admin dashboard (main page of Django Admin). </p>
  
  <p>Here is my template for Admin main page <code>./templates/admin/index.html</code>:</p>
  
  <pre><code>{% extends "admin/base_site.html" %}
  {% load i18n static %}
  
  {% block extrastyle %}{{ block.super }}
    &lt;link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}"/&gt;{% endblock %}
  
  {% block coltype %}colMS{% endblock %}
  
  {% block bodyclass %}{{ block.super }} dashboard{% endblock %}
  
  {% block breadcrumbs %}{% endblock %}
  
  {% block content %}
    &lt;div id="content-main"&gt;
  
      {% if app_list %}
        {% for app in app_list %}
          &lt;div class="app-{{ app.app_label }} module"&gt;
            &lt;table&gt;
              &lt;caption&gt;
                &lt;a href="{{ app.app_url }}" class="section"
                   title="{% blocktrans with name=app.name %}Models in the {{ name }} application{% endblocktrans %}"&gt;{{ app.name }}&lt;/a&gt;
              &lt;/caption&gt;
              {% for model in app.models %}
                &lt;tr class="model-{{ model.object_name|lower }}"&gt;
                  {% if model.admin_url %}
                    &lt;th scope="row"&gt;&lt;a href="{{ model.admin_url }}"&gt;{{ model.name }}&lt;/a&gt;&lt;/th&gt;
                  {% else %}
                    &lt;th scope="row"&gt;{{ model.name }}&lt;/th&gt;
                  {% endif %}
  
                  {% if model.add_url and request.user.is_superuser %}
                    &lt;td&gt;&lt;a href="{{ model.add_url }}" class="addlink"&gt;{% trans 'Add' %}&lt;/a&gt;&lt;/td&gt;
                  {% else %}
                    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                  {% endif %}
  
                  {% if model.admin_url and request.user.is_superuser %}
                    &lt;td&gt;&lt;a href="{{ model.admin_url }}" class="changelink"&gt;{% trans 'Change' %}&lt;/a&gt;&lt;/td&gt;
                  {% else %}
                    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                  {% endif %}
                &lt;/tr&gt;
              {% endfor %}
            &lt;/table&gt;
          &lt;/div&gt;
        {% endfor %}
      {% else %}
        &lt;p&gt;{% trans "You don't have permission to edit anything." %}&lt;/p&gt;
      {% endif %}
    &lt;/div&gt;
  {% endblock %}
  </code></pre>
  
  <p>I delete sidebar block, because I never use it. And it looks like:</p>
  
  <p><a href="https://i.stack.imgur.com/nixcU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nixcU.png" alt="enter image description here"></a></p>
  
  <p>I want to add to each model link count of objects. For example, <code>Cities (23)</code>, <code>Citizenships (102)</code> and similar for all models in list. I try to add function with <code>@property</code> decorator in <code>./app/models.py</code>, but it's not working:</p>
  
  <pre><code>class APIConfig(models.Model):
      ...
      @property
      def with_active_status(self):
          return self.objects.filter(is_active=True).count()
      ...
  </code></pre>
  
  <p>I call this property in Admin template, like <code>{{ model.with_active_status }}</code> and it shows nothing.</p>