~ubuntu-branches/ubuntu/utopic/python-django/utopic

« back to all changes in this revision

Viewing changes to tests/regressiontests/admin_filters/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
[ 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:
 
1
from __future__ import unicode_literals
 
2
 
1
3
from django.contrib.auth.models import User
2
4
from django.db import models
3
 
 
4
 
 
 
5
from django.utils.encoding import python_2_unicode_compatible
 
6
 
 
7
 
 
8
@python_2_unicode_compatible
5
9
class Book(models.Model):
6
10
    title = models.CharField(max_length=50)
7
11
    year = models.PositiveIntegerField(null=True, blank=True)
9
13
    contributors = models.ManyToManyField(User, verbose_name="Verbose Contributors", related_name='books_contributed', blank=True, null=True)
10
14
    is_best_seller = models.NullBooleanField(default=0)
11
15
    date_registered = models.DateField(null=True)
12
 
    no = models.IntegerField(verbose_name=u'number', blank=True, null=True) # This field is intentionally 2 characters long. See #16080.
 
16
    no = models.IntegerField(verbose_name='number', blank=True, null=True) # This field is intentionally 2 characters long. See #16080.
13
17
 
14
 
    def __unicode__(self):
 
18
    def __str__(self):
15
19
        return self.title
16
20
 
17
21
 
 
22
@python_2_unicode_compatible
18
23
class Department(models.Model):
19
24
    code = models.CharField(max_length=4, unique=True)
20
25
    description = models.CharField(max_length=50, blank=True, null=True)
21
26
 
22
 
    def __unicode__(self):
 
27
    def __str__(self):
23
28
        return self.description
24
29
 
 
30
@python_2_unicode_compatible
25
31
class Employee(models.Model):
26
32
    department = models.ForeignKey(Department, to_field="code")
27
33
    name = models.CharField(max_length=100)
28
34
 
29
 
    def __unicode__(self):
30
 
        return self.name
 
 
b'\\ No newline at end of file'
 
35
    def __str__(self):
 
36
        return self.name