Hello, I've constructed a table in the model with an owner field. I
wish it to always default to the logged in user id being auth.user.id.

I tried setting it as default, as in:
Field('owner', 'reference auth_user', readable=False, writable=False,
default=auth.user.id),

problem is logging out would raise the nonetype exception.

If I don't put a default the owner field is not being automatically
set.

my create() looks like this:
@auth.requires_login()
def create():
     form = crud.create(db.mytable, next = URL('index'))
     return dict(form=form)

so, any way to set owner to auth.user.id as the object is being
created?

Reply via email to