![]() |
App Engine Python SDK
v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
|
Public Member Functions | |
def | __init__ |
def | validate |
def | default_value |
def | get_updated_value_for_datastore |
![]() | |
def | __init__ |
def | __property_config__ |
def | __get__ |
def | __set__ |
def | default_value |
def | validate |
def | empty |
def | get_value_for_datastore |
def | get_updated_value_for_datastore |
def | make_value_from_datastore_index_value |
def | make_value_from_datastore |
def | datastore_type |
Static Public Member Functions | |
def | now |
Public Attributes | |
auto_now | |
auto_now_add | |
![]() | |
verbose_name | |
name | |
default | |
required | |
validator | |
choices | |
indexed | |
creation_counter | |
model_class | |
Static Public Attributes | |
data_type = datetime.datetime | |
![]() | |
int | creation_counter = 0 |
data_type = str | |
The base class of all of our date/time properties. We handle common operations, like converting between time tuples and datetime instances.
def google.appengine.ext.db.DateTimeProperty.__init__ | ( | self, | |
verbose_name = None , |
|||
auto_now = False , |
|||
auto_now_add = False , |
|||
kwds | |||
) |
Construct a DateTimeProperty Args: 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.
def google.appengine.ext.db.DateTimeProperty.default_value | ( | self | ) |
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.
def google.appengine.ext.db.DateTimeProperty.get_updated_value_for_datastore | ( | self, | |
model_instance | |||
) |
Get new value for property to send to datastore. Returns: now() as appropriate to the date-time instance in the odd case where auto_now is set to True, else AUTO_UPDATE_UNCHANGED.
|
static |
Get now as a full datetime value. Returns: 'now' as a whole timestamp, including both time and date.
def google.appengine.ext.db.DateTimeProperty.validate | ( | self, | |
value | |||
) |
Validate datetime. Returns: A valid value. Raises: BadValueError if property is not instance of 'datetime'.