views:

71

answers:

2

Imagine you have a column called

usercreated = db.ReferenceProperty(User)

And you want this field to automaticly filled when first putted to store. Like this did for auto_date. Is this possible?

+1  A: 

According to the docs, your best bet is going to be a redefinition of the property class you're working with in order to override the default_value() method. You could also try duckpunching, though it's probably not a viable option.

Silas
+3  A: 

The User property type has an auto_current_user flag, which is an easy solution if your using google accounts for authentication.

http://code.google.com/appengine/docs/python/datastore/typesandpropertyclasses.html#UserProperty

Sam
right, I simply use my own. And already create the same implement, as they do, only for Reference
dynback.com