mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +00:00
Fixed #30259 -- Fixed crash of admin views when properties don't have admin_order_field attribute.
This commit is contained in:
parent
93daed25a4
commit
7cbcf2e2cb
3 changed files with 6 additions and 2 deletions
|
@ -60,6 +60,10 @@ class Article(models.Model):
|
|||
property_year.admin_order_field = 'date'
|
||||
model_property_year = property(property_year)
|
||||
|
||||
@property
|
||||
def model_month(self):
|
||||
return self.date.month
|
||||
|
||||
|
||||
class Book(models.Model):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue