From f8e6d53bb5f970f3ae966bc6ed0fb65c3aa44931 Mon Sep 17 00:00:00 2001 From: Gregor Aisch Date: Tue, 2 Apr 2013 13:44:14 +0200 Subject: [PATCH] docs! --- dataset/persistence/table.py | 11 +++++++++-- docs/_themes/kr/static/flasky.css_t | 8 ++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/dataset/persistence/table.py b/dataset/persistence/table.py index 38f6e36..d7c0901 100644 --- a/dataset/persistence/table.py +++ b/dataset/persistence/table.py @@ -38,7 +38,11 @@ class Table(object): matching the name of a column to be created, and the given SQLAlchemy column type will be used. Otherwise, the type is guessed from the row's value, defaulting to a simple unicode - field. """ + field. + :: + data = dict(id=10, title='I am a banana!') + table.insert(data, ['id']) + """ if ensure: self._ensure_columns(row, types=types) self.database.engine.execute(self.table.insert(row)) @@ -133,7 +137,7 @@ class Table(object): return idx def find_one(self, **filter): - """Works just like :py:meth:`find() ` but returns only the first result. + """Works just like :py:meth:`find() ` but returns only one result. :: row = table.find_one(country='United States') """ @@ -157,6 +161,9 @@ class Table(object): results = table.find(country='France', year=1980) # just return the first 10 rows results = table.find(country='France', _limit=10) + + You can sort the results by single or multiple columns. For descending order + please append a minus sign to the column name:: # sort results by a column 'year' results = table.find(country='France', order_by='year') # return all rows sorted by multiple columns (by year in descending order) diff --git a/docs/_themes/kr/static/flasky.css_t b/docs/_themes/kr/static/flasky.css_t index 363963e..40b6da6 100755 --- a/docs/_themes/kr/static/flasky.css_t +++ b/docs/_themes/kr/static/flasky.css_t @@ -350,13 +350,13 @@ pre { } dl pre, blockquote pre, li pre { - margin-left: -60px; - padding-left: 60px; + margin-left: 0px; + padding-left: 15px; } dl dl pre { - margin-left: -90px; - padding-left: 90px; + margin-left: 0px; + padding-left: 15px; } tt {