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"
|
2010-04-11 16:35:04 +08:00
|
|
|
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()
|