Skip to content
This repository
Browse code

Updated DateProperty to auto-convert from datetime

  • Loading branch information...
commit 33873ac2f4e7fb3f65cb1f86803d32cf8ac1181f 1 parent 9967ff1
authored

Showing 1 changed file with 4 additions and 1 deletion. Show diff stats Hide diff stats

  1. 5  boto/sdb/db/property.py
5  boto/sdb/db/property.py
@@ -378,7 +378,10 @@ def validate(self, value):
378 378
     def get_value_for_datastore(self, model_instance):
379 379
         if self.auto_now:
380 380
             setattr(model_instance, self.name, self.now())
381  
-        return Property.get_value_for_datastore(self, model_instance)
  381
+        val = Property.get_value_for_datastore(self, model_instance)
  382
+        if isinstance(val, datetime.datetime):
  383
+            val = val.date()
  384
+        return val
382 385
 
383 386
     def now(self):
384 387
         return datetime.date.today()

0 notes on commit 33873ac

Please sign in to comment.
Something went wrong with that request. Please try again.