Hi all,

when I use this db definition:

db.define_table('gender', Field('name'), format='%(name)s')
db.define_table('person', Field('name'), Field('gender_id','reference 
gender'), format='%(name)s')
db.define_table('thing',  Field('name'), Field('owner_id','reference person'
,format='%(name)s')

with this controller:

@auth.requires_login()
def mytest():
    grid=SQLFORM.smartgrid(db.thing)
    return dict(grid=grid)


the owner_id's name is displayed when function above is called, but if I 
want to restrict owner_id (to male only for example) with this :

db.thing.owner_id.requires=IS_IN_DB(db(db.person.gender_id==db.gender(name=
'M').id),'person.id')

the owner_id's name is not displayed anymore, I see the owner id instead.

I found a workaround by using 
db.thing.owner_id.represent
but I was wondering if this is a bug ?

Thanks!
Mirko

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to