title: custom filter - needs two arguments
body: <p>In the project manage app I'm working on it should be possible to edit/delete a ticket if you are the owner of (i.e. the creator of) the ticket and/or the admin of the project the ticket belongs to.</p>
  
  <p>In the template for showing a project I want to use a custom filter to determine this, used as seen here:</p>
  
  <pre><code>{% if ticket|owner_or_admin:user %}
      &lt;p&gt;
          &lt;a href="{% url ticket_edit project.id %}"&gt;Edit&lt;/a&gt;
          &lt;a id="delete_link" href="{% url ticket_delete ticket.id %}"&gt;Delete&lt;/a&gt;
      &lt;/p&gt;
  {% endif %}
  </code></pre>
  
  <p>Below is a try of creating this custom filter, but this throws an error ('owner_or_admin requires 2 arguments, 1 provided'):</p>
  
  <pre><code>@register.filter(name='owner_or_admin')
  def ownership(ticket, project, user):
      if ticket.user == user:
          return true;    
      else:
          if project.added_by_user == user:
              return true
      return false
  </code></pre>
  
  <p><strong>models:</strong></p>
  
  <pre><code>class Project(models.Model):
      ... fields ...
      added_by_user = models.ForeignKey(User)
  
  class Ticket(models.Model):
      ... fields ...
      user = models.ForeignKey(User)
  </code></pre>
  
  <p>So, how do I provide two arguments? Is the custom filter correct otherwise?</p>
  
  <p>Thanks in advance!</p>