summaryrefslogtreecommitdiff
path: root/tests/regressiontests/modeladmin/models.py
diff options
context:
space:
mode:
authorLuke Plant <L.Plant.98@cantab.net>2011-02-21 21:20:41 +0000
committerLuke Plant <L.Plant.98@cantab.net>2011-02-21 21:20:41 +0000
commit31d0f2fa29b766d4e739e8ad650b43435b48dfbf (patch)
tree86183cdefa2a5c7035bf0019d03cf76983adbead /tests/regressiontests/modeladmin/models.py
parent25c217bc170d275a2db65fd9c9faa064797d4b2f (diff)
[1.2.X] Fixed #11058 - list_display_links doesn't allow callables not defined in the model
Thanks to dvine for the report and julien for the patch. Backport of [15619] from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15621 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/modeladmin/models.py')
-rw-r--r--tests/regressiontests/modeladmin/models.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/regressiontests/modeladmin/models.py b/tests/regressiontests/modeladmin/models.py
index 20dfe2ce98..cb2e3d1b0b 100644
--- a/tests/regressiontests/modeladmin/models.py
+++ b/tests/regressiontests/modeladmin/models.py
@@ -8,7 +8,7 @@ class Band(models.Model):
name = models.CharField(max_length=100)
bio = models.TextField()
sign_date = models.DateField()
-
+
def __unicode__(self):
return self.name
@@ -32,5 +32,8 @@ class ValidationTestModel(models.Model):
pub_date = models.DateTimeField()
band = models.ForeignKey(Band)
+ def decade_published_in(self):
+ return self.pub_date.strftime('%Y')[:3] + "0's"
+
class ValidationTestInlineModel(models.Model):
parent = models.ForeignKey(ValidationTestModel)