'Get value from property to send to datastore.
We retrieve a datetime.date from the model instance and return a
datetime.datetime instance with the time set to zero.
See base class method documentation for details.'

def get_value_for_datastore(self, model_instance):

    value = super(DateProperty, self).get_value_for_datastore(model_instance)
    if (value is not None):
        assert isinstance(value, datetime.date)
        value = _date_to_datetime(value)
    return value
