title: Django using try: and except:
body: <p>I was wondering if its possible to write a handling exceptions like with 2 or more except with different task to do.</p>
  
  <p>I'm using  <code>Django==1.6.1</code> and <code>Python 2.7</code></p>
  
  <pre><code>try:
      foo_instance = foo.objects.get(field_name='unknown')
  
  except foo.DoesNotExist:
      new_rec = foo.objects.create(field_name='unknown')
      new_rec.save()
  
      foo_instance = foo.objects.get(field_name='unknown')
  
  except foo.MultipleObjectsReturned:
      foo_list = foo.objects.filter(field_name='unknown')
      for record in foo_list[1:]:
         print 'Deleting foo id: ', record.id
         record.delete()
  
      foo_instance = foo.objects.get(field_name='unknown')
  </code></pre>