google.appengine.ext.db.TimeProperty

A time property, which stores a time without a date.

Inherits From: DateTimeProperty, Property, expected_type

verbose_name Verbose name is always first parameter.
auto_now Date/time property is updated with the current time every time it is saved to the datastore. Useful for properties that want to track the modification time of an instance.
auto_now_add Date/time is set to the when its instance is created. Useful for properties that record the creation time of an entity.

Child Classes

class data_type

Methods

datastore_type

View source

Deprecated backwards-compatible accessor method for self.data_type.

default_value

View source

Default value for datetime.

Returns
value of now() as appropriate to the date-time instance if auto_now or auto_now_add is set, else user configured default value implementation.

empty

View source

Is time property empty.

0:0 (midnight) is not an empty value.

Returns
True if value is None, else False.

get_updated_value_for_datastore

View source

Get new value for property to send to datastore.

Returns
now() as appropriate to the time instance in the odd case where auto_now is set to True, else AUTO_UPDATE_UNCHANGED.

get_value_for_datastore

View source

Get value from property to send to datastore.

We retrieve a datetime.time from the model instance and return a datetime.datetime instance with the date set to 1/1/1970.

See base class method documentation for details.

make_value_from_datastore

View source

Native representation of this property.

We receive a datetime.datetime retrieved from the entity and return a datetime.date instance representing its time portion.

See base class method documentation for details.

make_value_from_datastore_index_value

View source

now

View source

Get now as a time datetime value.

Returns
'time' part of 'now' only.

validate

View source

Validate datetime.

Returns
A valid value.

Raises
BadValueError if property is not instance of 'datetime'.

creation_counter 2