According to the ndb doc, auto_now_add
would set property to current date/time when entity is created.
I would like to know how the value is determined in async ops - i.e., Is it determined by the time when an in-memory model object is created, or by the time when the model is actually written to datastore?
The docs say " The automatic value is not generated until the entity is written; that is, these options don't provide dynamic defaults. (These details differ from the old db API.)
Note: When a transaction writing a property with auto_now_add=True fails and is later retried, it will reuse the same time value as on the original try rather than update it to the time of the retry. If the transaction fails permanently, the property's value will still be set in the in-memory copy of the entity."