Error when executing a set definition

15 views
Skip to first unread message

icodk

unread,
Nov 5, 2025, 6:38:30 PM (8 days ago) Nov 5
to py4web
I have the following set, that works fine in a requires = IS_IN_DB(myset...
my set looks like 
<Set ((NOT ("depot"."id" IN (SELECT "user_depot"."depot" FROM "user_depot" WHERE ("user_depot"."user" = 1)))) AND ("depot"."site" = 5))>

When I do :
res=db(myset).select(db.user_depot.id)
I get the following error:
psycopg2.errors.SyntaxError: syntax error at or near "<"
LINE 1: SELECT "user_depot"."id" FROM "user_depot" WHERE <Set ((NOT ...
                                                         ^
How can I execute it and get result ?
I actually only interested in something like db(myset).count() that should also work (according to the doc about select)

Massimiliano

unread,
Nov 6, 2025, 2:41:20 AM (8 days ago) Nov 6
to icodk, py4web
IIRC db(query) returns a set, so should be myset.select()

--
You received this message because you are subscribed to the Google Groups "py4web" group.
To unsubscribe from this group and stop receiving emails from it, send an email to py4web+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/py4web/17222e5d-c956-4d84-b47a-d02e2a5ca17an%40googlegroups.com.


--
Massimiliano

icodk

unread,
Nov 6, 2025, 4:01:39 AM (8 days ago) Nov 6
to py4web
Thanks it works. Also myset.count()
Reply all
Reply to author
Forward
0 new messages