Sure, but you'll either need to use GROUP BY...HAVING or a derived
table (subquery). Try get_objects_from_sql().
- Perrin
This is helpful thank you. Now I have managed to construct an SQL query that works e.g.:
Now I've found the answer. For posterity, as the manual clearly says the GROUP BY method should be 'fully formed SQL'. So the following GROUP BY argument worked: 't1.uid having count(t1.uid) > 5'
You shouldn't try to use "group by" with the Manager's get_objects()
method (or anything derived from it, like get_persons()). It expects
to create a tree of RDBO objects from the results, one object for each
uniquely identified row in a table. Once you use "group by," you're
definitely not going to get result rows like that. I suggest making a
Manager method that uses get_objects_sql() to build the WHERE part of
the query, builds the rest of the query "manually," runs it, then
builds and returns whatever result objects or data structures are
appropriate.
-John