1. Felipe Prenholato
  2. django-timedelta-field

Commits

Matthew Schinckel  committed e642b8e

I keep changing my mind.
Empty string in value now goes to None, regardless.

  • Participants
  • Parent commits 8cde0b7
  • Branches default

Comments (0)

Files changed (1)

File timedelta/fields.py

View file
  • Ignore whitespace
             return value
         if isinstance(value, int):
             return datetime.timedelta(seconds=value)
+        if value == "":
+            return None
         return parse(value)
     
     def get_prep_value(self, value):