title: How to call model methods in template
body: <p>I want to call the model method get_url() in the  tag in the template</p>
  <p>models.py</p>
  <pre><code>class Department(Base):
  
    department_name = models.CharField(max_length=128)
    description = models.TextField(null=True, blank=True)
  
    def get_url(self):
        ct = ContentType.objects.get(model='department')
        url_name = ' %s:%s ' % (ct.app_label, ct.model)
        return reverse(url_name, args=(self.object_id))
  </code></pre>
  <p>template.html</p>
  <pre><code>    &lt;a href=&quot;{% ? ... how to call the model method here.... ? %}&quot;&gt;&lt;/a&gt;
  </code></pre>