extended intro example

This commit is contained in:
Gregor Aisch 2013-04-03 14:28:42 +02:00
parent e6844e50bd
commit b002f454ca

View File

@ -20,9 +20,13 @@ In short, dataset combines the straightforwardness of NoSQL interfaces with the
import dataset
db = dataset.connect('sqlite:///database.db')
db['sometable'].insert(dict(name='John Doe', age=37))
db['sometable'].insert(dict(name='Jane Doe', age=34, gender='female'))
db = dataset.connect('sqlite:///:memory:')
table = db['sometable']
table.insert(dict(name='John Doe', age=37))
table.insert(dict(name='Jane Doe', age=34, gender='female'))
john = table.find_one(name='John Doe')
Here is `similar code, without dataset <https://gist.github.com/gka/5296492>`_.