Craig Younkins
Craig Younkins

Reputation: 1430

AppEngine bulk loader and automatically created property values

In my model I have a property:

created = db.DateTimeProperty(required=True, auto_now_add=True)

When an object of this type is created in the datastore, the created property is automatically populated.

When I use the bulk loader tool with a table which does not have this field, the field is not automatically populated when I upload to AppEngine, at which time new objects are created.

How can I make it set the created time on new objects uploaded from the bulk loader?

Upvotes: 1

Views: 296

Answers (1)

Craig Younkins
Craig Younkins

Reputation: 1430

Add something like the following to bulkloader.yaml:

- property: created
  external_name: created
  import_transform: "lambda x: datetime.datetime.utcnow()"

Upvotes: 2

Related Questions