~ubuntu-branches/ubuntu/saucy/python-django/saucy-updates

« back to all changes in this revision

Viewing changes to tests/modeltests/choices/models.py

  • Committer: Package Import Robot
  • Author(s): Luke Faraone, Jakub Wilk, Luke Faraone
  • Date: 2013-05-09 15:10:47 UTC
  • mfrom: (1.1.21) (4.4.27 sid)
  • Revision ID: package-import@ubuntu.com-20130509151047-aqv8d71oj9wvcv8c
Tags: 1.5.1-2
[ Jakub Wilk ]
* Use canonical URIs for Vcs-* fields.

[ Luke Faraone ]
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
"""
11
11
 
12
12
from django.db import models
 
13
from django.utils.encoding import python_2_unicode_compatible
13
14
 
14
15
 
15
16
GENDER_CHOICES = (
17
18
    ('F', 'Female'),
18
19
)
19
20
 
 
21
@python_2_unicode_compatible
20
22
class Person(models.Model):
21
23
    name = models.CharField(max_length=20)
22
24
    gender = models.CharField(max_length=1, choices=GENDER_CHOICES)
23
25
 
24
 
    def __unicode__(self):
 
26
    def __str__(self):
25
27
        return self.name