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

« back to all changes in this revision

Viewing changes to tests/modeltests/ordering/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:
14
14
"""
15
15
 
16
16
from django.db import models
17
 
 
18
 
 
 
17
from django.utils.encoding import python_2_unicode_compatible
 
18
 
 
19
 
 
20
@python_2_unicode_compatible
19
21
class Article(models.Model):
20
22
    headline = models.CharField(max_length=100)
21
23
    pub_date = models.DateTimeField()
22
24
    class Meta:
23
25
        ordering = ('-pub_date', 'headline')
24
26
 
25
 
    def __unicode__(self):
 
27
    def __str__(self):
26
28
        return self.headline
27
29
 
 
30
@python_2_unicode_compatible
28
31
class ArticlePKOrdering(models.Model):
29
32
    headline = models.CharField(max_length=100)
30
33
    pub_date = models.DateTimeField()
31
34
    class Meta:
32
35
        ordering = ('-pk',)
33
36
 
34
 
    def __unicode__(self):
 
37
    def __str__(self):
35
38
        return self.headline