Thank you Anthony!
That was exactly what I did last night, with a post I found here.
I just replied here with some questions, so I'll have to wait for my post
to be approved and published so you can see it.
I'd appreciate any insights.
Regards,
Pablo.
El viernes, 31 de julio de 2015, 12:5
Thank You Massimo!
Yesterday after I posted my question, I found another post here and went
ahead and do this:
On the image table I defined:
*Field('user_id', db.auth_user, default=auth.user_id, writable=False,
readable=False),*
And then I also defined this:
*db.image.user_id.requires = IS_I
Using auth.signature is a good approach (though may be overkill if you
don't need the other fields it creates). But for reference, to achieve what
you want, just hide the user_id field and give it a default value:
Field('user_id', 'reference auth_user', writable=False, default=auth.user_id
)
An
Do not do this:
db.define_table('image',
Field('user_id', 'reference auth_user'),
Field('file', 'upload'),
Field('description', 'text'))
do
db.define_table('image',
Field('file', 'upload'),
Field('description', 'text
4 matches
Mail list logo