title: Customizing django admin site - in row buttons
body: <p>Suppose I have a model like this: </p>
  
  <pre><code>class Foo(models.Model):
      name = models.CharField(max_length=50)
      year = models.IntegerField(max_length=4)
      some_value = models.IntegerField(default=0)
  </code></pre>
  
  <p>and </p>
  
  <pre><code>class Bar(models.Model)
      name = models.CharField(max_length=50)
      foo = models.ForeignKey(Foo)
  </code></pre>
  
  <p>Then I register my models in django AdminSite using FooAdmin class:</p>
  
  <pre><code>class FooAdmin(admin.ModelAdmin):
      list_display = ['name', 'year', 'some_value']
  </code></pre>
  
  <p>It works fine, but for some reason I need to add two buttons for each Foo row in my admin site. Let's say I'd call them 'Related_button' and 'Action_button'  </p>
  
  <p>I need those buttons to be in each row and to behave as follows:<br>
  -when user clicks on 'Related_button', he is redirected to django admin site where all Bars related with particullar Foo object are listed<br>
  -when user clicks on 'Action_button', a field some_value in object of class Foo is set to a custom value, let's say 15. But before that, confirm popup (Are you sure? y/n) should appear.</p>
  
  <p>How to do that? I figured out that I could do something like:</p>
  
  <pre><code>def button(self, obj):
      return '''&lt;input type="button" value="button" /&gt;'''
  button.short_description = 'Action'
  button.allow_tags = True
  list_display = ['name', 'year', 'some_value', 'action']
  </code></pre>
  
  <p>in my FooAdmin which causes a button to appear in each row. But how can I set an action for that button?</p>