1
0
mirror of https://github.com/django/django.git synced 2025-10-26 07:06:08 +00:00

[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
This commit is contained in:
Luke Plant
2011-02-21 21:20:41 +00:00
parent 25c217bc17
commit 31d0f2fa29
4 changed files with 24 additions and 10 deletions

View File

@@ -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)