fix DateField.sortValue (Py3): return 0 when None
This commit is contained in:
parent
3ac1a6c512
commit
40fe51b3a9
1 changed files with 3 additions and 2 deletions
|
@ -67,11 +67,12 @@ class DateField(BaseDateField):
|
|||
|
||||
def getSortValue(self, row):
|
||||
value = self.getRawValue(row)
|
||||
if value is not None:
|
||||
if value:
|
||||
value = date2TimeStamp(value)
|
||||
if getattr(self, 'sortDesc', False):
|
||||
value = -value
|
||||
return value
|
||||
return 0
|
||||
|
||||
|
||||
class IntegerField(BaseIntegerField):
|
||||
|
|
Loading…
Add table
Reference in a new issue