Querying based on linked table values

I don’t think this is possible given the current query system, but wanted to check to see if anyone knew how to do it.

I’d like to query based on fields in linked tables. For example, if I’m querying an order items table and it has a link to an order row, I’d like to be able to query based on the date of the order. Something like:

app_tables.order_items.search(
  order['date']=q.less_than(
    datetime(day=14, month=12, year=2017),
  )
)

That doesn’t work.

I have a couple of workarounds in mind, but they either use up additional space in the data tables (denormalizing to store the date in the order items), or additional time on the server (fetching the order rows so I can query order items using q.any_of).

Does this feature exist and I just can’t work out how to use it?

1 Like

5 posts were merged into an existing topic: Allow for nested subqueries in query API