Re: [web2py] DAL unique on multiple fields

2018-10-14 Thread Marco Mansilla
You can add it right after table definition or BEFORE validation in controller and it should work. El dom., 14 de oct. de 2018 13:03, lucas escribió: > I didn't think so, so I was making sure. I added it under onvalidation > under the controller. and also added it to the Postgres database as

Re: [web2py] DAL unique on multiple fields

2018-10-14 Thread lucas
I didn't think so, so I was making sure. I added it under onvalidation under the controller. and also added it to the Postgres database as a custom index. thank you for verifying with me. Lucas -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

Re: [web2py] DAL unique on multiple fields

2018-10-14 Thread Marco Mansilla
No, but you can use requires=IS_NOT_IN_DB(table, query), if you need to make a self reference to the table you must write it after table definiton or in controller before calling the validator, and can be applied to multiple fields on the same table. Hope it helps. El dom., 14 de oct. de 2018

[web2py] DAL unique on multiple fields

2018-10-14 Thread lucas
hello one and all, is there a DAL level way to impose a constraint on a single table but unique on multiple fields within that single table? thanx in advance, lucas -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -