Thanks Max, but, with that line raise an error:

 
db.comentario_vendedor.vendedor_id.requires=IS_IN_DB(db(db.auth_user.profesional=='True'),auth_user.first_name)
NameError: name 'auth_user' is not defined

fixed with:

db.comentario_vendedor.vendedor_id.requires=IS_IN_DB(db(db.auth_user.profes­
ional=='True'),db.auth_user.first_name)




On 20 nov, 15:33, mdipierro <[email protected]> wrote:
> This line
>
> db.comentario_vendedor.vendedor_id.requires=IS_IN_SET(db(db.auth_user.profe­sional=='True').select(db.auth_user.first_name))
>
> should be
>
> db.comentario_vendedor.vendedor_id.requires=IS_IN_DB(db(db.auth_user.profes­ional=='True'),auth_user.first_name)
>
> On Nov 20, 6:43 am, puercoespin <[email protected]>
> wrote:
>
>
>
> > Hello,
>
> >  I have a custom db.auth_user, with a boolean field
>
> > """
> > ....
> > Field('profesional', 'boolean', default=False),
> > .....
> > .....
> > format='%(first_name)s',
>
> >     )
>
> > """
>
> > and a table that references:
>
> > '''
> > db.define_table('comentario_vendedor',
> >       Field('vendedor_id', db.auth_user,),
> > ....
>
> > ''''
>
> > I want to display in 'vendedor_id' only db.auth_user.profesional=True,
> > so:
>
> > '''
> > db.comentario_vendedor.vendedor_id.requires=IS_IN_SET(db(db.auth_user.profe­sional=='True').select(db.auth_user.first_name))
> > '''
> > But I display <Row {'firs_name':'nombrevendedor1'}> <Row
> > {'firs_name':'nombrevendedor2'}> etc.
>
> > Where's the error?
>
> > Thanks!- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -

Reply via email to