Include support for custom result row types, fixes #41.

This commit is contained in:
Friedrich Lindenberg
2015-05-23 16:15:17 +02:00
parent 8b411636f3
commit 56d5b232d8
9 changed files with 97 additions and 15 deletions
+11
View File
@@ -144,6 +144,17 @@ with unique values in one or more columns::
# Get one user per country
db['user'].distinct('country')
Finally, you can use the ``row_type`` parameter to choose the data type in which
results will be returned::
import dataset
from stuf import stuf
db = dataset.connect('sqlite:///mydatabase.db', row_type=stuf)
Now contents will be returned in ``stuf`` objects (basically, ``dict``
objects whose elements can be acessed as attributes (``item.name``) as well as
by index (``item['name']``).
Running custom SQL queries
--------------------------