|
From: <sub...@co...> - 2006-01-26 17:33:37
|
Author: phd
Date: 2006-01-26 10:33:29 -0700 (Thu, 26 Jan 2006)
New Revision: 1541
Modified:
SQLObject/docs/FAQ.txt
Log:
Added a section "What about GROUP BY, UNION, etc?"
Modified: SQLObject/docs/FAQ.txt
===================================================================
--- SQLObject/docs/FAQ.txt 2006-01-26 16:24:27 UTC (rev 1540)
+++ SQLObject/docs/FAQ.txt 2006-01-26 17:33:29 UTC (rev 1541)
@@ -440,3 +440,24 @@
for constraint in constraints:
connection.query(constraint)
+
+What about GROUP BY, UNION, etc?
+--------------------------------
+
+In short - not every query can be represented in SQLObject. SQLOBject's
+objects are instances of "table" clasess::
+
+ class MyTable(SQLObject):
+ ...
+
+ my_table_row = MyTable.get(id)
+
+Now my_table_row is an instance of MyTable class and represents a row in
+the my_table table. But for a statement with GROUP BY like this::
+
+ SELECT my_column, COUNT(*) FROM my_table GROUP BY my_column;
+
+there is no table, there is no corresponding "table" class, and SQLObject
+cannot return a list of meaningful objects.
+
+You can use a lower-level machinery available in SQLBuilder_.
|