Experimental natural language search in grid

67 views
Skip to first unread message

Massimo

unread,
May 26, 2025, 3:30:40 AM5/26/25
to py4web
Given 

db.define_table('thing', Field('name'))

and

@action("grid")
@action.uses(auth, "generic.html")
def _():
grid = Grid(db.thing)
return locals()

The grid now provides, by default, a natural language search box

cat.png

You search like:

name is not null
name is Cat
name is "Cat"
name belongs Cat,Dog,"Funny Hippo" or (not name contains "x" and id is greater than 3)

quotes are optional. You can use (...) to group. You can use normal == != < > <= >= operators.

I could use some help testing before I publish this.



Massimo

unread,
May 27, 2025, 3:03:05 AM5/27/25
to py4web
Here is a new experimental grid using this https://github.com/web2py/py4web/pull/974
Reply all
Reply to author
Forward
0 new messages