[web2py] Re: SQLFORM.grid id representation bug?

2012-07-09 Thread Johann Spies
On Monday, 9 July 2012 14:35:41 UTC+2, Remco K wrote: Hi everyone, I'm working with SQLFORM.grid but I cant get the referenced table representation to work. The only thing i get is the ID of the referenced table(s): *db.py: * db.define_table('clients', Field('number'),

[web2py] Re: SQLFORM.grid id representation bug?

2012-07-09 Thread Anthony
db.define_table('clients', Field('number'), Field('name'), format='%(name)s') Then you don't have to explicitly define the IS_IN_DB validator, as sessions.client_id will get one by default with the format set to the db.clients format attribute. In

Re: [web2py] Re: SQLFORM.grid id representation bug?

2012-07-09 Thread Remco K
Thanks for the answers. This representation works perfectly when i show the content in a dropdown so i think this has more to do with SQLFORM.grid... 2012/7/9 Anthony abasta...@gmail.com db.define_table('clients', Field('number'), Field('name'),

Re: [web2py] Re: SQLFORM.grid id representation bug?

2012-07-09 Thread Anthony
On Monday, July 9, 2012 12:32:11 PM UTC-4, Remco K wrote: Thanks for the answers. This representation works perfectly when i show the content in a dropdown so i think this has more to do with SQLFORM.grid... The dropdown is controlled by the IS_IN_DB validator, not the field's represent

Re: [web2py] Re: SQLFORM.grid id representation bug?

2012-07-09 Thread Remco K
Hmm oke. I tried it on different ways. Now i use the PowerTable plugin and it's working. There is nothing wrong with the IS_IN_DB() validator as far as i can see. I use: db.define_table('clients', Field('number'), Field('name'),

Re: [web2py] Re: SQLFORM.grid id representation bug?

2012-07-09 Thread Anthony
db.sessions.client_id.requires = IS_IN_DB(db, db.clients.id, '%(name)s') No, as I mentioned, you should *not* explicitly define the IS_IN_DB validator. You will get one automatically when you create a reference field. If the referenced table has a format attribute, then that format