PageRenderTime 54ms CodeModel.GetById 49ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/tests/modeltests/basic/models.py

https://code.google.com/p/mango-py/
Python | 17 lines | 8 code | 3 blank | 6 comment | 0 complexity | d3916321f7e9dcbdf50a4d0358982139 MD5 | raw file
 1# coding: utf-8
 2"""
 31. Bare-bones model
 4
 5This is a basic model with only two non-primary-key fields.
 6"""
 7from django.db import models, DEFAULT_DB_ALIAS, connection
 8
 9class Article(models.Model):
10    headline = models.CharField(max_length=100, default='Default headline')
11    pub_date = models.DateTimeField()
12
13    class Meta:
14        ordering = ('pub_date','headline')
15
16    def __unicode__(self):
17        return self.headline