Changes between Initial Version and Version 1 of Ticket #31558


Ignore:
Timestamp:
May 11, 2020, 12:28:33 AM (5 years ago)
Author:
Mariusz Felisiak
Comment:

Thanks. This is definitely a new feature (see similar ticket #30259 for admin_order_field support). We can support it but when using the property() function and not with decorator, that's why I updated the ticket description.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #31558

    • Property Triage Stage UnreviewedAccepted
    • Property Summary Boolean attribute for a property getter of a model doesn’t active the “on/off” icon in the admin siteSupport the use of boolean attribute on properties in the admin.
    • Property Type BugNew feature
    • Property Version 3.0master
  • Ticket #31558 – Description

    initial v1  
    88    publication_date = models.DateTimeField('Date of publication')
    99
    10     @property
    1110    def was_published_recently(self):
    1211        timenow = timezone.now()
     
    1413        return recent <= self.publication_date <= timenow
    1514
    16     was_published_recently.fget.admin_order_field = 'publication_date'
    17     was_published_recently.fget.short_description = 'Published Recently?'
    18     was_published_recently.fget.boolean = True
     15    was_published_recently.admin_order_field = 'publication_date'
     16    was_published_recently.short_description = 'Published Recently?'
     17    was_published_recently.boolean = True
     18    was_published_recently = property(was_published_recently)
    1919}}}
    2020
Back to Top