In most cases, that behavior can be achieved simply by using the "default" and "onupdate" keyword arguments to fields:

def get_current_user(param=None):
   return "current_user"

class Movie(Entity):
   title = Field(Unicode(30))
   year = Field(Integer)
   created_by = Field(Unicode(30), default=get_current_user)
   updated_by = Field(Unicode(30), onupdate=get_current_user)

If you need some argument to be passed to the get_current_user function, the following extension might help:

record_owner.py

test_record_owner.py

Attachments