Maybe I should update, because with web2py 2.3.2 I can't search a la "contains" in all the columns...
Richard On Wed, May 1, 2013 at 4:47 PM, Cliff Kachinske <cjk...@gmail.com> wrote: > I like the latest search in grid/smartgrid a lot. A very nice piece of > work. > > I do have a tiny concern about exposing table names to the world at large, > though. Maybe it would be possible to obfuscate the table name by > presenting the plural of the table. > > > On Wednesday, May 1, 2013 4:23:23 PM UTC-4, Richard wrote: > >> Wasn't know about your explanation for point 3 (contains() manner), so >> this one seems to be solved. Will test if we can do, a <space that mean &> >> b to make sure it search for a & b in association in all the columns >> though... >> >> About 2, I agree with you it is a bigger challenge. But I think it could >> work at least for single table, because it makes no sens to give the same >> label twice into the same table. In case of join, the issue could be solve >> the same way we do with web2py query adding the tablename. Only difference >> we should use a label for table name there too and web2py has no notion of >> table label... >> >> table_name_label.field_name_**label !=, ==, etc. value searched >> >> This map into : >> >> table_name.field_name==value searched >> >> ? >> >> Richard >> >> >> On Wed, May 1, 2013 at 3:27 PM, Niphlod <nip...@gmail.com> wrote: >> >>> uhm...... >>> 2. seems hard but not impossible. However, what do you need specifically >>> ? instead of *auth_user.first_name="hello"* just *First name="hello"*or >>> *whatever suites me best=Hello*? What if some column names collide ? >>> 3. unless you're referring to custom-coded filters in datatables.net, >>> all it has is a single input that searches all fields in a "contains()" >>> manner, i.e. if you put "a" in it it will filter all the rows where "a" is >>> found in any column. That's what grid does by default if you put "a" in the >>> main input field and press "search". >>> >>> In other words, current search widget is easy enough for every user out >>> there, extremely flexibile while retaining a "quick" way to search through >>> your table ..... we can shift that balance a little but up to a certain >>> point: it kinda has to suite everybody's needs. >>> >>> On Wednesday, May 1, 2013 7:59:07 PM UTC+2, Richard wrote: >>>> >>>> Hello, >>>> >>>> I did some research about SQLFORM.grid() Search Question and I >>>> summarize what I found here : >>>> >>>> Search requirements for me to use SQLFROM.grid() in place of >>>> Datatables.net : >>>> >>>> >>>> 1. Need to be able to search the representation for referenced >>>> fields *(Solved)* >>>> 2. No database field name in the Query Builder... >>>> - I would like the labels to be used in the Query Builder and >>>> then be translated into the proper query passed to the URL *(Open, >>>> a solution seems to exist)* >>>> 3. User should have the option to search over all the fields >>>> (like Datatables.net search/filter)* (Open, a solution seems to >>>> exist)* >>>> >>>> >>>> *1)* I was searching a way to search representation of a referenced >>>> field and I found this answer (from Niphold) : >>>> >>>> How to search referenced field (query with join) : >>>> https://groups.google.com/d/**ms**g/web2py/Z4HZNNLlyYs/**lknATE2iK**JoJ<https://groups.google.com/d/msg/web2py/Z4HZNNLlyYs/lknATE2iKJoJ> >>>> >>>> >>>> *2)* But then, I realize that for the construction of the search the >>>> user has to know the database fields names (the labels are not taking into >>>> account by the query builder) in order to create his search... >>>> >>>> I try to solve that with SQLFROM.grid headers=HEADERS_DICT, but still >>>> the query constructor display the database field name and not there >>>> labels... >>>> >>>> About that issue, I found this thread that seem to address the problem >>>> into a elegant way : >>>> >>>> https://groups.google.com/**foru**m/?fromgroups=#!topic/**web2py/** >>>> JVDZtZCsRTw<https://groups.google.com/forum/?fromgroups=#!topic/web2py/JVDZtZCsRTw> >>>> >>>> So, the solution seems to exist, but I would have to implement my own >>>> or reuse this one... Did this had been (could be) added built-in in >>>> SQLFORM.grid()?? >>>> >>>> *3)* I would like to preserve something I consider as a "feature". >>>> Actually I use Datatables.net almost every where I need a grid, and my >>>> users know how use the search/filter of Datatables, so I would have this >>>> option into SQLFORM.grid()... >>>> >>>> I found this share : >>>> https://groups.google.com/d/**ms**g/web2py/9_1ECdKHKUo/**8OISg7o8O**VIJ<https://groups.google.com/d/msg/web2py/9_1ECdKHKUo/8OISg7o8OVIJ> >>>> >>>> Again, I have to test and see how it fit beside the query builder... >>>> Having to different input search may be weird for user or lead to >>>> misunderstanding. >>>> >>>> >>>> Is there other important things I should know about SQLFORM.grid() and >>>> search? >>>> >>>> What the future for a better search experience with SQLFORM.grid()? >>>> >>>> I think the greatest advantage of SQLFORM.grid() over other Javascript >>>> grid for instance is the ability to create a search and share it to other >>>> user as a link... Of course there is also the possibility to create more >>>> complexe query than a simple filter box. And I want these features in my >>>> app. >>>> >>>> Richard >>>> >>>> Other thread : >>>> >>>> https://groups.google.com/**foru**m/?fromgroups=#!topic/**web2py/** >>>> hKe6lI25Bv4<https://groups.google.com/forum/?fromgroups=#!topic/web2py/hKe6lI25Bv4> >>>> >>>> Related : >>>> >>>> https://groups.google.com/**foru**m/?fromgroups=#!topic/**web2py/** >>>> bScnOfTCvL8<https://groups.google.com/forum/?fromgroups=#!topic/web2py/bScnOfTCvL8> >>>> >>> -- >>> >>> --- >>> 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+un...@**googlegroups.com. >>> >>> For more options, visit >>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out> >>> . >>> >>> >>> >> >> -- > > --- > 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. > > > -- --- 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.