summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext/sqlsoup.py
diff options
context:
space:
mode:
authorJonathan Ellis <jbellis@gmail.com>2006-08-01 19:10:34 +0000
committerJonathan Ellis <jbellis@gmail.com>2006-08-01 19:10:34 +0000
commitd6a6d67b8cded2280c216c6d224852f6b8a8d79e (patch)
tree1a435845d41b3e725a853e3df72c1d0403b6e75c /lib/sqlalchemy/ext/sqlsoup.py
parentddaf28461b302ab6c66ee563a1a5c483eafaa396 (diff)
downloadsqlalchemy-d6a6d67b8cded2280c216c6d224852f6b8a8d79e.tar.gz
r/m _reset method
Diffstat (limited to 'lib/sqlalchemy/ext/sqlsoup.py')
-rw-r--r--lib/sqlalchemy/ext/sqlsoup.py16
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/sqlalchemy/ext/sqlsoup.py b/lib/sqlalchemy/ext/sqlsoup.py
index 15d23a7c6..2f41b13bd 100644
--- a/lib/sqlalchemy/ext/sqlsoup.py
+++ b/lib/sqlalchemy/ext/sqlsoup.py
@@ -62,7 +62,7 @@ Here's a quick summary of these methods:
See the SqlAlchemy documentation for details:
- http://www.sqlalchemy.org/docs/datamapping.myt#datamapping_query for general info and examples,
-- http://www.sqlalchemy.org/docs/sqlconstruction.myt for details on construction WHERE clauses.
+- http://www.sqlalchemy.org/docs/sqlconstruction.myt for details on constructing WHERE clauses.
Modifying objects
@@ -118,17 +118,17 @@ to users, and uses that as the join condition automatically.
>>> join1.select_by(name='Joe Student')
[MappedJoin(name='Joe Student',email='student@example.edu',password='student',classname=None,admin=0,book_id=1,user_name='Joe Student',loan_date=datetime.datetime(2006, 7, 12, 0, 0))]
-If you join tables that have an identical column name, pass use_lables to your
-select:
- >>> db.with_labels(join1).select()
- [MappedUsersLoansJoin(users_name='Joe Student',users_email='student@example.edu',users_password='student',users_classname=None,users_admin=0,loans_book_id=1,loans_user_name='Joe Student',loans_loan_date=datetime.datetime(2006, 7, 12, 0, 0))]
-
You can compose arbitrarily complex joins by combining Join objects with
tables or other joins.
>>> join2 = db.join(join1, db.books)
>>> join2.select()
[MappedJoin(name='Joe Student',email='student@example.edu',password='student',classname=None,admin=0,book_id=1,user_name='Joe Student',loan_date=datetime.datetime(2006, 7, 12, 0, 0),id=1,title='Mustards I Have Known',published_year='1989',authors='Jones')]
+If you join tables that have an identical column name, wrap your join with "with_labels",
+and all the columns will be prefixed with their table name:
+ >>> db.with_labels(join1).select()
+ [MappedUsersLoansJoin(users_name='Joe Student',users_email='student@example.edu',users_password='student',users_classname=None,users_admin=0,loans_book_id=1,loans_user_name='Joe Student',loans_loan_date=datetime.datetime(2006, 7, 12, 0, 0))]
+
Advanced Use
============
@@ -314,10 +314,6 @@ class SqlSoup:
objectstore.get_session().flush()
def rollback(self):
objectstore.clear()
- def _reset(self):
- # for debugging
- self._cache = {}
- self.rollback()
def _map(self, selectable):
try:
t = self._cache[selectable]