title: Django admin : How to call an action on a click of custom button?
body: <p>I have a django admin view displaying a list of orders. I have added a custom button, which when clicked should perform a certain action.</p>
  
  <p><a href="https://i.stack.imgur.com/70coo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/70coo.png" alt="enter image description here"></a></p>
  
  <p>So I have a function defined in my services.py file as :</p>
  
  <pre><code>def penalty(order):
    #Do something
  </code></pre>
  
  <p>So, how should I call this function when <strong>Penalty</strong> is clicked. I can create a view, but how to call it?</p>