/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
- # coding: utf-8
- """
- 1. Bare-bones model
- This is a basic model with only two non-primary-key fields.
- """
- from django.db import models, DEFAULT_DB_ALIAS, connection
- class Article(models.Model):
- headline = models.CharField(max_length=100, default='Default headline')
- pub_date = models.DateTimeField()
- class Meta:
- ordering = ('pub_date','headline')
- def __unicode__(self):
- return self.headline