4
Django handles transactions in three different ways. The default is to commit
5
each transaction upon a write, but you can decorate a function to get
6
commit-on-success behavior. Alternatively, you can manage the transaction
9
from __future__ import unicode_literals
11
from django.db import models
12
from django.utils.encoding import python_2_unicode_compatible
15
@python_2_unicode_compatible
16
class Reporter(models.Model):
17
first_name = models.CharField(max_length=30)
18
last_name = models.CharField(max_length=30)
19
email = models.EmailField()
22
ordering = ('first_name', 'last_name')
25
return "%s %s" % (self.first_name, self.last_name)