Querying for None and querying for all in data tables

As for passing query objects from client to server, it does indeed seem to be working.

The ‘if’ on the server side let’s me avoid the ‘All’ query. However, I still did not see a way to do the “not None” and “None” cases. Could you be more explicit?

I looked at both the Searching (querying) a Table and the anvil.tables.query API reference before initially posting.

Edit: I just noticed a link in Searching (querying) a Table for a blog post that gives more details on querying.

They have a case for filtering out None’s

Edit 2:

app_tables.machines.search(ipv6=q.not_(q.not_(None)))

seems to be working for me for the “find the Nones” case but doesn’t feel very elegant

Edit 3:

Adding even more to the chaos…

app_tables.machines.search(ipv6=q.any_of(q.not_(q.not_(None)), q.not_(None)))

seems to be working for the ‘All’ case

1 Like