2010-01-10 11:36:59 +08:00
|
|
|
from django.db import models
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Article(models.Model):
|
|
|
|
"""
|
|
|
|
A simple Article model for testing
|
|
|
|
"""
|
2010-02-01 22:12:56 +08:00
|
|
|
site = models.ForeignKey('sites.Site', related_name="admin_articles")
|
2010-01-10 11:36:59 +08:00
|
|
|
title = models.CharField(max_length=100)
|
|
|
|
title2 = models.CharField(max_length=100, verbose_name="another name")
|
|
|
|
created = models.DateTimeField()
|
|
|
|
|
|
|
|
def test_from_model(self):
|
|
|
|
return "nothing"
|
|
|
|
|
|
|
|
def test_from_model_with_override(self):
|
|
|
|
return "nothing"
|
|
|
|
test_from_model_with_override.short_description = "not what you expect"
|
2010-02-26 21:17:43 +08:00
|
|
|
|
|
|
|
class Count(models.Model):
|
|
|
|
num = models.PositiveSmallIntegerField()
|