mirror of
https://github.com/django/django.git
synced 2025-10-31 20:09:34 +00:00
Fixed #12434: Made pretty_name handle empty string and None as input. Thanks ales_zoulek and gabrielhurley.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12794 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
3c59067a4f
commit
cc6e9b2286
2 changed files with 6 additions and 3 deletions
|
|
@ -35,6 +35,7 @@ class Article(models.Model):
|
|||
def model_year(self):
|
||||
return self.date.year
|
||||
model_year.admin_order_field = 'date'
|
||||
model_year.short_description = ''
|
||||
|
||||
class Book(models.Model):
|
||||
"""
|
||||
|
|
@ -103,6 +104,7 @@ class ArticleAdmin(admin.ModelAdmin):
|
|||
def modeladmin_year(self, obj):
|
||||
return obj.date.year
|
||||
modeladmin_year.admin_order_field = 'date'
|
||||
modeladmin_year.short_description = None
|
||||
|
||||
class CustomArticle(models.Model):
|
||||
content = models.TextField()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue