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

[web2py] Re: searchable=True

2018-10-14 Thread Anthony
The "searchable" argument can be a function that takes the list of fields in the grid and the submitted keywords and returns a DAL Query object, so you can create a custom search function. For an example, see the default search function:

[web2py] searchable=True

2018-10-14 Thread Andrea Fae'
Hello, in a grid, if you type searchable=True default) you can search by EVERY field in the grid. But I want to use the search box not to all fields in te view, but only in some of them. Is it possible or I have to create a specific search form? Can you send me some example? Thank you --

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] broken inframe video on manual web page

2018-10-14 Thread Nico Zanferrari
Hi, it seems that there is a missing reference on the online web2py manual at http://www.web2py.com/init/default/documentation . There is a missing video pointing at vimeo - no more available ;-( Nico --

[web2py] just for the records: API rest with basic auth

2018-10-14 Thread Jaime Sempere
Hi, I have had a lot of problems to set up an API REST with basic auth, finally I have used the next code, I left it here for anyone that may need it: from gluon.serializers import json auth.settings.allow_basic_login = True @request.restful() def api(): response.view = 'generic.json'

[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) -