Skip to content

Commit

Permalink
Need get_prep_value in order to handle putting a flexibledate in that
Browse files Browse the repository at this point in the history
field
  • Loading branch information
JordanReiter committed May 3, 2011
1 parent 40a47ba commit b8f80e7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions flexibledatefield/fields.py
Expand Up @@ -165,6 +165,13 @@ def to_python(self, value):
return flexibledate(value)
except ValueError, inst:
raise ValidationError(inst)

def get_prep_value(self, value):
try:
value = value.value
except:
pass
return value

def get_db_prep_lookup(self, lookup_type, value, connection, prepared=False):
if isinstance(value, flexibledate):
Expand Down

0 comments on commit b8f80e7

Please sign in to comment.