Skip to content

Commit

Permalink
default DateTime value is None
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielfalcao committed Sep 3, 2015
1 parent e7e35db commit 70d35de
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions repocket/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from repocket._cache import MODELS


def get_current_time():
def get_current_time(field):
return datetime.utcnow()


Expand Down Expand Up @@ -62,6 +62,7 @@ def to_python(self, value, simple=False):

if simple:
return value

safe_value = self.to_string(value)

return {
Expand Down Expand Up @@ -178,7 +179,7 @@ class DateTime(Attribute):
"""
__base_type__ = datetime
__empty_value__ = get_current_time
__empty_value__ = None

def __init__(self, auto_now=False, null=False):
super(DateTime, self).__init__(null=null)
Expand Down

0 comments on commit 70d35de

Please sign in to comment.