~ubuntu-branches/debian/sid/python-django/sid

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Luke Faraone, Jakub Wilk, Luke Faraone
  • Date: 2013-05-09 15:10:47 UTC
  • mfrom: (6.2.12 experimental)
  • Revision ID: package-import@ubuntu.com-20130509151047-g79qsrewg1yl43h5
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:
5
5
This is a basic model with only two non-primary-key fields.
6
6
"""
7
7
from django.db import models
8
 
 
9
 
 
 
8
from django.utils.encoding import python_2_unicode_compatible
 
9
 
 
10
 
 
11
@python_2_unicode_compatible
10
12
class Article(models.Model):
11
13
    headline = models.CharField(max_length=100, default='Default headline')
12
14
    pub_date = models.DateTimeField()
14
16
    class Meta:
15
17
        ordering = ('pub_date','headline')
16
18
 
17
 
    def __unicode__(self):
 
19
    def __str__(self):
18
20
        return self.headline