forked from 0x2620/pandora
fix dates < 1900
This commit is contained in:
parent
5222d706de
commit
c01be0dc2c
1 changed files with 2 additions and 1 deletions
|
@ -17,6 +17,7 @@ from django.db.models import Q, Sum, Max
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib.auth.models import User, Group
|
from django.contrib.auth.models import User, Group
|
||||||
from django.db.models.signals import pre_delete
|
from django.db.models.signals import pre_delete
|
||||||
|
from django.utils import datetime_safe
|
||||||
|
|
||||||
import ox
|
import ox
|
||||||
from ox.django import fields
|
from ox.django import fields
|
||||||
|
@ -805,7 +806,7 @@ class Item(models.Model):
|
||||||
elif sort_type == 'date':
|
elif sort_type == 'date':
|
||||||
value = self.get(source)
|
value = self.get(source)
|
||||||
if isinstance(value, basestring):
|
if isinstance(value, basestring):
|
||||||
value = datetime.strptime(value, '%Y-%m-%d')
|
value = datetime_safe.datetime.strptime(value, '%Y-%m-%d')
|
||||||
set_value(s, name, value)
|
set_value(s, name, value)
|
||||||
|
|
||||||
#sort keys based on database, these will always be available
|
#sort keys based on database, these will always be available
|
||||||
|
|
Loading…
Reference in a new issue