You do not need this

db.define_table('atable',
    SQLField('var1'),
 
SQLField('var2',default=db(db.auth_user.id==auth.user_id).select(db.auth_user.initials).first().initials))

you can do

db.define_table('atable',
    Field('var1'),
    Field('var2',default=auth.user and auth.user.initials))

btw, SQLField is deprecated, only an alias for Field.

On Jun 8, 5:29 pm, Jean Guy <[email protected]> wrote:
> Could it be a good practice to implement electronic signature of the
> database records like this :
>
> db.define_table('atable',
>     SQLField('var1'),
>     SQLField('var2',default=db(db.auth_user.id
> ==auth.user_id).select(db.auth_user.initials).first().initials))
>
> It needs that the user be authentified otherwise the app won't work, but as
> long as the user as to be authentified for doing accessing the database, it
> should be ok...
>
> What do you think?
>
> My goal is to have each records signed (stamped with users initials
> actually) at the database level.
>
> Thanks.
>
> Jonhy

Reply via email to