[Sqlalchemy-commits] [1031] sqlalchemy/branches/sql_rearrangement/test: dev
Brought to you by:
zzzeek
From: <co...@sq...> - 2006-02-25 03:25:39
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><style type="text/css"><!-- #msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; } #msg dt { float: left; width: 6em; font-weight: bold; } #msg dt:after { content:':';} #msg dl, #msg dt, #msg ul, #msg li { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; } #msg dl a { font-weight: bold} #msg dl a:link { color:#fc3; } #msg dl a:active { color:#ff0; } #msg dl a:visited { color:#cc6; } h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; } #msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; } #msg ul, pre { overflow: auto; } #patch { width: 100%; } #patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;} #patch .propset h4, #patch .binary h4 {margin:0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;} #patch .propset .diff, #patch .binary .diff {padding:10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;} #patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;} #patch .lines, .info {color:#888;background:#fff;} --></style> <title>[1031] sqlalchemy/branches/sql_rearrangement/test: dev</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>1031</dd> <dt>Author</dt> <dd>zzzeek</dd> <dt>Date</dt> <dd>2006-02-24 21:25:29 -0600 (Fri, 24 Feb 2006)</dd> </dl> <h3>Log Message</h3> <pre>dev</pre> <h3>Modified Paths</h3> <ul> <li><a href="#sqlalchemybranchessql_rearrangementlibsqlalchemyansisqlpy">sqlalchemy/branches/sql_rearrangement/lib/sqlalchemy/ansisql.py</a></li> <li><a href="#sqlalchemybranchessql_rearrangementlibsqlalchemymappingmapperpy">sqlalchemy/branches/sql_rearrangement/lib/sqlalchemy/mapping/mapper.py</a></li> <li><a href="#sqlalchemybranchessql_rearrangementlibsqlalchemymappingobjectstorepy">sqlalchemy/branches/sql_rearrangement/lib/sqlalchemy/mapping/objectstore.py</a></li> <li><a href="#sqlalchemybranchessql_rearrangementlibsqlalchemyschemapy">sqlalchemy/branches/sql_rearrangement/lib/sqlalchemy/schema.py</a></li> <li><a href="#sqlalchemybranchessql_rearrangementlibsqlalchemysqlpy">sqlalchemy/branches/sql_rearrangement/lib/sqlalchemy/sql.py</a></li> <li><a href="#sqlalchemybranchessql_rearrangementtestselectpy">sqlalchemy/branches/sql_rearrangement/test/select.py</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="sqlalchemybranchessql_rearrangementlibsqlalchemyansisqlpy"></a> <div class="modfile"><h4>Modified: sqlalchemy/branches/sql_rearrangement/lib/sqlalchemy/ansisql.py (1030 => 1031)</h4> <pre class="diff"><span> <span class="info">--- sqlalchemy/branches/sql_rearrangement/lib/sqlalchemy/ansisql.py 2006-02-25 02:47:53 UTC (rev 1030) +++ sqlalchemy/branches/sql_rearrangement/lib/sqlalchemy/ansisql.py 2006-02-25 03:25:29 UTC (rev 1031) </span><span class="lines">@@ -357,6 +357,7 @@ </span><span class="cx"> self.strings[table] = "" </span><span class="cx"> </span><span class="cx"> def visit_tableclause(self, table): </span><ins>+ print "HI" </ins><span class="cx"> self.froms[table] = table.name </span><span class="cx"> self.strings[table] = "" </span><span class="cx"> </span></span></pre></div> <a id="sqlalchemybranchessql_rearrangementlibsqlalchemymappingmapperpy"></a> <div class="modfile"><h4>Modified: sqlalchemy/branches/sql_rearrangement/lib/sqlalchemy/mapping/mapper.py (1030 => 1031)</h4> <pre class="diff"><span> <span class="info">--- sqlalchemy/branches/sql_rearrangement/lib/sqlalchemy/mapping/mapper.py 2006-02-25 02:47:53 UTC (rev 1030) +++ sqlalchemy/branches/sql_rearrangement/lib/sqlalchemy/mapping/mapper.py 2006-02-25 03:25:29 UTC (rev 1031) </span><span class="lines">@@ -262,7 +262,7 @@ </span><span class="cx"> """returns an instance of the object based on the given identifier, or None </span><span class="cx"> if not found. The *ident argument is a </span><span class="cx"> list of primary key columns in the order of the table def's primary key columns.""" </span><del>- key = objectstore.get_id_key(ident, self.class_, self.primarytable) </del><ins>+ key = objectstore.get_id_key(ident, self.class_) </ins><span class="cx"> #print "key: " + repr(key) + " ident: " + repr(ident) </span><span class="cx"> return self._get(key, ident) </span><span class="cx"> </span><span class="lines">@@ -284,7 +284,7 @@ </span><span class="cx"> </span><span class="cx"> </span><span class="cx"> def identity_key(self, *primary_key): </span><del>- return objectstore.get_id_key(tuple(primary_key), self.class_, self.primarytable) </del><ins>+ return objectstore.get_id_key(tuple(primary_key), self.class_) </ins><span class="cx"> </span><span class="cx"> def instance_key(self, instance): </span><span class="cx"> return self.identity_key(*[self._getattrbycolumn(instance, column) for column in self.pks_by_table[self.table]]) </span><span class="lines">@@ -683,7 +683,7 @@ </span><span class="cx"> return statement </span><span class="cx"> </span><span class="cx"> def _identity_key(self, row): </span><del>- return objectstore.get_row_key(row, self.class_, self.identitytable, self.pks_by_table[self.table]) </del><ins>+ return objectstore.get_row_key(row, self.class_, self.pks_by_table[self.table]) </ins><span class="cx"> </span><span class="cx"> def _instance(self, row, imap, result = None, populate_existing = False): </span><span class="cx"> """pulls an object instance from the given row and appends it to the given result </span></span></pre></div> <a id="sqlalchemybranchessql_rearrangementlibsqlalchemymappingobjectstorepy"></a> <div class="modfile"><h4>Modified: sqlalchemy/branches/sql_rearrangement/lib/sqlalchemy/mapping/objectstore.py (1030 => 1031)</h4> <pre class="diff"><span> <span class="info">--- sqlalchemy/branches/sql_rearrangement/lib/sqlalchemy/mapping/objectstore.py 2006-02-25 02:47:53 UTC (rev 1030) +++ sqlalchemy/branches/sql_rearrangement/lib/sqlalchemy/mapping/objectstore.py 2006-02-25 03:25:29 UTC (rev 1031) </span><span class="lines">@@ -48,7 +48,7 @@ </span><span class="cx"> self.hash_key = hash_key </span><span class="cx"> _sessions[self.hash_key] = self </span><span class="cx"> </span><del>- def get_id_key(ident, class_, table): </del><ins>+ def get_id_key(ident, class_): </ins><span class="cx"> """returns an identity-map key for use in storing/retrieving an item from the identity </span><span class="cx"> map, given a tuple of the object's primary key values. </span><span class="cx"> </span><span class="lines">@@ -62,10 +62,10 @@ </span><span class="cx"> selectable - a Selectable object which represents all the object's column-based fields. </span><span class="cx"> this Selectable may be synonymous with the table argument or can be a larger construct </span><span class="cx"> containing that table. return value: a tuple object which is used as an identity key. """ </span><del>- return (class_, table.hash_key(), tuple(ident)) </del><ins>+ return (class_, tuple(ident)) </ins><span class="cx"> get_id_key = staticmethod(get_id_key) </span><span class="cx"> </span><del>- def get_row_key(row, class_, table, primary_key): </del><ins>+ def get_row_key(row, class_, primary_key): </ins><span class="cx"> """returns an identity-map key for use in storing/retrieving an item from the identity </span><span class="cx"> map, given a result set row. </span><span class="cx"> </span><span class="lines">@@ -80,7 +80,7 @@ </span><span class="cx"> this Selectable may be synonymous with the table argument or can be a larger construct </span><span class="cx"> containing that table. return value: a tuple object which is used as an identity key. </span><span class="cx"> """ </span><del>- return (class_, table.hash_key(), tuple([row[column] for column in primary_key])) </del><ins>+ return (class_, tuple([row[column] for column in primary_key])) </ins><span class="cx"> get_row_key = staticmethod(get_row_key) </span><span class="cx"> </span><span class="cx"> class SessionTrans(object): </span></span></pre></div> <a id="sqlalchemybranchessql_rearrangementlibsqlalchemyschemapy"></a> <div class="modfile"><h4>Modified: sqlalchemy/branches/sql_rearrangement/lib/sqlalchemy/schema.py (1030 => 1031)</h4> <pre class="diff"><span> <span class="info">--- sqlalchemy/branches/sql_rearrangement/lib/sqlalchemy/schema.py 2006-02-25 02:47:53 UTC (rev 1030) +++ sqlalchemy/branches/sql_rearrangement/lib/sqlalchemy/schema.py 2006-02-25 03:25:29 UTC (rev 1031) </span><span class="lines">@@ -32,9 +32,6 @@ </span><span class="cx"> def _set_parent(self, parent): </span><span class="cx"> """a child item attaches itself to its parent via this method.""" </span><span class="cx"> raise NotImplementedError() </span><del>- def hash_key(self): - """returns a string that identifies this SchemaItem uniquely""" - return "%s(%d)" % (self.__class__.__name__, id(self)) </del><span class="cx"> def __repr__(self): </span><span class="cx"> return "%s()" % self.__class__.__name__ </span><span class="cx"> </span><span class="lines">@@ -120,8 +117,6 @@ </span><span class="cx"> </span><span class="cx"> """ </span><span class="cx"> super(Table, self).__init__(name) </span><del>- self._foreign_keys = [] - self._primary_key = [] </del><span class="cx"> self.engine = engine </span><span class="cx"> self.schema = kwargs.pop('schema', None) </span><span class="cx"> if self.schema is not None: </span><span class="lines">@@ -142,12 +137,6 @@ </span><span class="cx"> else: </span><span class="cx"> return self.schema + "." + self.name </span><span class="cx"> </span><del>- def hash_key(self): - return "Table(%s)" % string.join( - [repr(self.name)] + [self.engine.hash_key()] + - ["%s=%s" % (k, repr(getattr(self, k))) for k in ['schema']], ',' - ) - </del><span class="cx"> def reload_values(self, *args): </span><span class="cx"> """clears out the columns and other properties of this Table, and reloads them from the </span><span class="cx"> given argument list. This is used with the "redefine" keyword argument sent to the </span><span class="lines">@@ -259,9 +248,6 @@ </span><span class="cx"> engine = property(lambda s: s.table.engine) </span><span class="cx"> columns = property(lambda self:[self.column]) </span><span class="cx"> </span><del>- def _get_from_objects(self): - return [self.table] - </del><span class="cx"> def __repr__(self): </span><span class="cx"> return "Column(%s)" % string.join( </span><span class="cx"> [repr(self.name)] + [repr(self.type)] + </span></span></pre></div> <a id="sqlalchemybranchessql_rearrangementlibsqlalchemysqlpy"></a> <div class="modfile"><h4>Modified: sqlalchemy/branches/sql_rearrangement/lib/sqlalchemy/sql.py (1030 => 1031)</h4> <pre class="diff"><span> <span class="info">--- sqlalchemy/branches/sql_rearrangement/lib/sqlalchemy/sql.py 2006-02-25 02:47:53 UTC (rev 1030) +++ sqlalchemy/branches/sql_rearrangement/lib/sqlalchemy/sql.py 2006-02-25 03:25:29 UTC (rev 1031) </span><span class="lines">@@ -312,18 +312,6 @@ </span><span class="cx"> </span><span class="cx"> class ClauseElement(object): </span><span class="cx"> """base class for elements of a programmatically constructed SQL expression.""" </span><del>- def hash_key(self): - """returns a string that uniquely identifies the concept this ClauseElement - represents. - - two ClauseElements can have the same value for hash_key() iff they both correspond to - the exact same generated SQL. This allows the hash_key() values of a collection of - ClauseElements to be constructed into a larger identifying string for the purpose of - caching a SQL expression. - - Note that since ClauseElements may be mutable, the hash_key() value is subject to - change if the underlying structure of the ClauseElement changes.""" - raise NotImplementedError(repr(self)) </del><span class="cx"> def _get_from_objects(self): </span><span class="cx"> """returns objects represented in this ClauseElement that should be added to the </span><span class="cx"> FROM list of a query.""" </span><span class="lines">@@ -557,8 +545,6 @@ </span><span class="cx"> return [self.oid_column] </span><span class="cx"> else: </span><span class="cx"> return self.primary_key </span><del>- def hash_key(self): - return "FromClause(%s, %s)" % (repr(self.id), repr(self.from_name)) </del><span class="cx"> def accept_visitor(self, visitor): </span><span class="cx"> visitor.visit_fromclause(self) </span><span class="cx"> def count(self, whereclause=None, **params): </span><span class="lines">@@ -632,8 +618,6 @@ </span><span class="cx"> visitor.visit_bindparam(self) </span><span class="cx"> def _get_from_objects(self): </span><span class="cx"> return [] </span><del>- def hash_key(self): - return "BindParam(%s, %s, %s)" % (repr(self.key), repr(self.value), repr(self.shortname)) </del><span class="cx"> def typeprocess(self, value, engine): </span><span class="cx"> return self._get_convert_type(engine).convert_bind_param(value, engine) </span><span class="cx"> def compare(self, other): </span><span class="lines">@@ -679,8 +663,6 @@ </span><span class="cx"> for item in self.bindparams.values(): </span><span class="cx"> item.accept_visitor(visitor) </span><span class="cx"> visitor.visit_textclause(self) </span><del>- def hash_key(self): - return "TextClause(%s)" % repr(self.text) </del><span class="cx"> def _get_from_objects(self): </span><span class="cx"> return [] </span><span class="cx"> </span><span class="lines">@@ -691,8 +673,6 @@ </span><span class="cx"> visitor.visit_null(self) </span><span class="cx"> def _get_from_objects(self): </span><span class="cx"> return [] </span><del>- def hash_key(self): - return "Null" </del><span class="cx"> </span><span class="cx"> class ClauseList(ClauseElement): </span><span class="cx"> """describes a list of clauses. by default, is comma-separated, </span><span class="lines">@@ -703,8 +683,6 @@ </span><span class="cx"> if c is None: continue </span><span class="cx"> self.append(c) </span><span class="cx"> self.parens = kwargs.get('parens', False) </span><del>- def hash_key(self): - return string.join([c.hash_key() for c in self.clauses], ",") </del><span class="cx"> def copy_container(self): </span><span class="cx"> clauses = [clause.copy_container() for clause in self.clauses] </span><span class="cx"> return ClauseList(parens=self.parens, *clauses) </span><span class="lines">@@ -758,8 +736,6 @@ </span><span class="cx"> for c in self.clauses: </span><span class="cx"> f += c._get_from_objects() </span><span class="cx"> return f </span><del>- def hash_key(self): - return string.join([c.hash_key() for c in self.clauses], self.operator or " ") </del><span class="cx"> def compare(self, other): </span><span class="cx"> """compares this CompoundClause to the given item. </span><span class="cx"> </span><span class="lines">@@ -799,8 +775,6 @@ </span><span class="cx"> return BindParamClause(self.name, obj, shortname=self.name, type=self.type) </span><span class="cx"> def select(self): </span><span class="cx"> return select([self]) </span><del>- def hash_key(self): - return self.name + "(" + string.join([c.hash_key() for c in self.clauses], ", ") + ")" </del><span class="cx"> def _compare_type(self, obj): </span><span class="cx"> return self.type </span><span class="cx"> </span><span class="lines">@@ -816,8 +790,6 @@ </span><span class="cx"> return BinaryClause(self.left.copy_container(), self.right.copy_container(), self.operator) </span><span class="cx"> def _get_from_objects(self): </span><span class="cx"> return self.left._get_from_objects() + self.right._get_from_objects() </span><del>- def hash_key(self): - return self.left.hash_key() + (self.operator or " ") + self.right.hash_key() </del><span class="cx"> def accept_visitor(self, visitor): </span><span class="cx"> self.left.accept_visitor(visitor) </span><span class="cx"> self.right.accept_visitor(visitor) </span><span class="lines">@@ -888,9 +860,6 @@ </span><span class="cx"> statement""" </span><span class="cx"> return True </span><span class="cx"> </span><del>- def hash_key(self): - return "Join(%s, %s, %s, %s)" % (repr(self.left.hash_key()), repr(self.right.hash_key()), repr(self.onclause.hash_key()), repr(self.isouter)) - </del><span class="cx"> def select(self, whereclauses = None, **params): </span><span class="cx"> return select([self.left, self.right], whereclauses, from_obj=[self], **params) </span><span class="cx"> </span><span class="lines">@@ -946,10 +915,8 @@ </span><span class="cx"> def _exportable_columns(self): </span><span class="cx"> return self.selectable.columns </span><span class="cx"> </span><del>- def hash_key(self): - return "Alias(%s, %s)" % (self.selectable.hash_key(), repr(self.name)) - </del><span class="cx"> def accept_visitor(self, visitor): </span><ins>+ print "SEL", repr(self.selectable) </ins><span class="cx"> self.selectable.accept_visitor(visitor) </span><span class="cx"> visitor.visit_alias(self) </span><span class="cx"> </span><span class="lines">@@ -980,15 +947,11 @@ </span><span class="cx"> return self.obj._get_from_objects() </span><span class="cx"> def _make_proxy(self, selectable, name = None): </span><span class="cx"> return self.obj._make_proxy(selectable, name=self.name) </span><del>- - def hash_key(self): - return "Label(%s, %s)" % (self.name, self.obj.hash_key()) </del><span class="cx"> </span><span class="cx"> class ColumnClause(ColumnElement): </span><span class="cx"> """represents a textual column clause in a SQL statement. ColumnClause operates </span><span class="cx"> in two modes, one where its just any text that will be placed into the select statement, </span><span class="cx"> and "column" mode, where it represents a column attached to a table.""" </span><del>- </del><span class="cx"> def __init__(self, text, selectable=None): </span><span class="cx"> self.text = text </span><span class="cx"> self.table = selectable </span><span class="lines">@@ -1002,19 +965,13 @@ </span><span class="cx"> key = property(lambda self:self.text) </span><span class="cx"> _label = property(_get_label) </span><span class="cx"> default_label = property(lambda s:s._label) </span><del>- </del><span class="cx"> def accept_visitor(self, visitor): </span><span class="cx"> visitor.visit_columnclause(self) </span><del>- - def hash_key(self): </del><ins>+ def _get_from_objects(self): </ins><span class="cx"> if self.table is not None: </span><del>- return "ColumnClause(%s, %s)" % (self.text, util.hash_key(self.table)) </del><ins>+ return [self.table] </ins><span class="cx"> else: </span><del>- return "ColumnClause(%s)" % self.text - - def _get_from_objects(self): - return [] - </del><ins>+ return [] </ins><span class="cx"> def _bind_param(self, obj): </span><span class="cx"> if self.table.name is None: </span><span class="cx"> return BindParamClause(self.text, obj, shortname=self.text, type=self.type) </span><span class="lines">@@ -1030,6 +987,8 @@ </span><span class="cx"> super(TableClause, self).__init__(name) </span><span class="cx"> self.name = self.id = name </span><span class="cx"> self._columns = util.OrderedProperties() </span><ins>+ self._foreign_keys = [] + self._primary_key = [] </ins><span class="cx"> for c in columns: </span><span class="cx"> self.append_column(c) </span><span class="cx"> </span><span class="lines">@@ -1037,11 +996,13 @@ </span><span class="cx"> self._columns[c.text] = c </span><span class="cx"> c.table = self </span><span class="cx"> def _oid_col(self): </span><ins>+ if self.engine is None: + return None </ins><span class="cx"> # OID remains a little hackish so far </span><span class="cx"> if not hasattr(self, '_oid_column'): </span><span class="cx"> if self.engine.oid_column_name() is not None: </span><del>- self._oid_column = schema.Column(self.table.engine.oid_column_name(), sqltypes.Integer, hidden=True) - self._oid_column._set_parent(self.table) </del><ins>+ self._oid_column = schema.Column(self.engine.oid_column_name(), sqltypes.Integer, hidden=True) + self._oid_column._set_parent(self) </ins><span class="cx"> else: </span><span class="cx"> self._oid_column = None </span><span class="cx"> return self._oid_column </span><span class="lines">@@ -1061,8 +1022,10 @@ </span><span class="cx"> primary_key = property(lambda s:s._primary_key) </span><span class="cx"> foreign_keys = property(lambda s:s._foreign_keys) </span><span class="cx"> original_columns = property(_orig_columns) </span><del>- </del><ins>+ oid_column = property(_oid_col) </ins><span class="cx"> </span><ins>+ def accept_visitor(self, visitor): + visitor.visit_tableclause(self) </ins><span class="cx"> def _exportable_columns(self): </span><span class="cx"> raise NotImplementedError() </span><span class="cx"> def _group_parenthesized(self): </span><span class="lines">@@ -1071,7 +1034,7 @@ </span><span class="cx"> for f in self._get_from_objects(): </span><span class="cx"> data.setdefault(f.id, f) </span><span class="cx"> if asfrom: </span><del>- data[self.id] = self.table </del><ins>+ data[self.id] = self </ins><span class="cx"> def count(self, whereclause=None, **params): </span><span class="cx"> return select([func.count(1).label('count')], whereclause, from_obj=[self], **params) </span><span class="cx"> def join(self, right, *args, **kwargs): </span><span class="lines">@@ -1143,11 +1106,6 @@ </span><span class="cx"> order_by = kwargs.get('order_by', None) </span><span class="cx"> if order_by: </span><span class="cx"> self.order_by(*order_by) </span><del>- def hash_key(self): - return "CompoundSelect(%s)" % string.join( - [util.hash_key(s) for s in self.selects] + - ["%s=%s" % (k, repr(getattr(self, k))) for k in ['use_labels', 'keyword']], - ",") </del><span class="cx"> def _exportable_columns(self): </span><span class="cx"> return self.selects[0].columns </span><span class="cx"> def _proxy_column(self, column): </span><span class="lines">@@ -1240,7 +1198,6 @@ </span><span class="cx"> for f in column._get_from_objects(): </span><span class="cx"> f.accept_visitor(self._correlator) </span><span class="cx"> column._process_from_dict(self._froms, False) </span><del>- </del><span class="cx"> def _exportable_columns(self): </span><span class="cx"> return self._raw_columns </span><span class="cx"> def _proxy_column(self, column): </span><span class="lines">@@ -1265,24 +1222,6 @@ </span><span class="cx"> </span><span class="cx"> _hash_recursion = util.RecursionStack() </span><span class="cx"> </span><del>- def hash_key(self): - # selects call alot of stuff so we do some "recursion checking" - # to eliminate loops - if Select._hash_recursion.push(self): - return "recursive_select()" - try: - return "Select(%s)" % string.join( - [ - "columns=" + string.join([util.hash_key(c) for c in self._raw_columns],','), - "where=" + util.hash_key(self.whereclause), - "from=" + string.join([util.hash_key(f) for f in self.froms],','), - "having=" + util.hash_key(self.having), - "clauses=" + string.join([util.hash_key(c) for c in self.clauses], ',') - ] + ["%s=%s" % (k, repr(getattr(self, k))) for k in ['use_labels', 'distinct', 'limit', 'offset']], "," - ) - finally: - Select._hash_recursion.pop(self) - </del><span class="cx"> def clear_from(self, id): </span><span class="cx"> self.append_from(FromClause(from_name = None, from_key = id)) </span><span class="cx"> </span><span class="lines">@@ -1294,7 +1233,7 @@ </span><span class="cx"> fromclause._process_from_dict(self._froms, True) </span><span class="cx"> </span><span class="cx"> def _get_froms(self): </span><del>- return [f for f in self._froms.values() if self._correlated is None or not self._correlated.has_key(f.id)] </del><ins>+ return [f for f in self._froms.values() if f is not self and (self._correlated is None or not self._correlated.has_key(f.id))] </ins><span class="cx"> froms = property(lambda s: s._get_froms()) </span><span class="cx"> </span><span class="cx"> def accept_visitor(self, visitor): </span><span class="lines">@@ -1340,9 +1279,6 @@ </span><span class="cx"> class UpdateBase(ClauseElement): </span><span class="cx"> """forms the base for INSERT, UPDATE, and DELETE statements.""" </span><span class="cx"> </span><del>- def hash_key(self): - return str(id(self)) - </del><span class="cx"> def _process_colparams(self, parameters): </span><span class="cx"> """receives the "values" of an INSERT or UPDATE statement and constructs </span><span class="cx"> appropriate ind parameters.""" </span></span></pre></div> <a id="sqlalchemybranchessql_rearrangementtestselectpy"></a> <div class="modfile"><h4>Modified: sqlalchemy/branches/sql_rearrangement/test/select.py (1030 => 1031)</h4> <pre class="diff"><span> <span class="info">--- sqlalchemy/branches/sql_rearrangement/test/select.py 2006-02-25 02:47:53 UTC (rev 1030) +++ sqlalchemy/branches/sql_rearrangement/test/select.py 2006-02-25 03:25:29 UTC (rev 1031) </span><span class="lines">@@ -51,14 +51,12 @@ </span><span class="cx"> column('zip') </span><span class="cx"> ) </span><span class="cx"> </span><del>- </del><span class="cx"> class SQLTest(PersistTest): </span><span class="cx"> def runtest(self, clause, result, engine = None, params = None, checkparams = None): </span><span class="cx"> if engine is None: </span><span class="cx"> engine = db </span><span class="cx"> c = clause.compile(engine, params) </span><span class="cx"> self.echo("\nSQL String:\n" + str(c) + repr(c.get_params())) </span><del>- self.echo("\nHash Key:\n" + clause.hash_key()) </del><span class="cx"> cc = re.sub(r'\n', '', str(c)) </span><span class="cx"> self.assert_(cc == result, str(c) + "\n does not match \n" + result) </span><span class="cx"> if checkparams is not None: </span><span class="lines">@@ -75,13 +73,6 @@ </span><span class="cx"> myothertable.othername FROM mytable, myothertable") </span><span class="cx"> </span><span class="cx"> def testsubquery(self): </span><del>- - # TODO: a subquery in a column clause. - #self.runtest( - # select([table, select([table2.c.id])]), - # """""" - #) - </del><span class="cx"> s = select([table1], table1.c.name == 'jack') </span><span class="cx"> print [key for key in s.c.keys()] </span><span class="cx"> self.runtest( </span><span class="lines">@@ -139,15 +130,15 @@ </span><span class="cx"> </span><span class="cx"> def testand(self): </span><span class="cx"> self.runtest( </span><del>- select(['*'], and_(table1.c.id == 12, table1.c.name=='asdf', table2.c.name == 'foo', "sysdate() = today()")), </del><ins>+ select(['*'], and_(table1.c.myid == 12, table1.c.name=='asdf', table2.c.othername == 'foo', "sysdate() = today()")), </ins><span class="cx"> "SELECT * FROM mytable, myothertable WHERE mytable.myid = :mytable_myid AND mytable.name = :mytable_name AND myothertable.othername = :myothertable_othername AND sysdate() = today()" </span><span class="cx"> ) </span><span class="cx"> </span><span class="cx"> def testor(self): </span><span class="cx"> self.runtest( </span><del>- select([table], and_( - table1.c.id == 12, - or_(table2.c.name=='asdf', table2.c.name == 'foo', table2.c.id == 9), </del><ins>+ select([table1], and_( + table1.c.myid == 12, + or_(table2.c.othername=='asdf', table2.c.othername == 'foo', table2.c.otherid == 9), </ins><span class="cx"> "sysdate() = today()", </span><span class="cx"> )), </span><span class="cx"> "SELECT mytable.myid, mytable.name, mytable.description FROM mytable, myothertable WHERE mytable.myid = :mytable_myid AND (myothertable.othername = :myothertable_othername OR myothertable.othername = :myothertable_othername_1 OR myothertable.otherid = :myothertable_otherid) AND sysdate() = today()", </span><span class="lines">@@ -156,7 +147,7 @@ </span><span class="cx"> </span><span class="cx"> def testoperators(self): </span><span class="cx"> self.runtest( </span><del>- table1.select((table1.c.id != 12) & ~(table1.c.name=='john')), </del><ins>+ table1.select((table1.c.myid != 12) & ~(table1.c.name=='john')), </ins><span class="cx"> "SELECT mytable.myid, mytable.name, mytable.description FROM mytable WHERE mytable.myid != :mytable_myid AND NOT (mytable.name = :mytable_name)" </span><span class="cx"> ) </span><span class="cx"> </span><span class="lines">@@ -166,35 +157,35 @@ </span><span class="cx"> </span><span class="cx"> def testmultiparam(self): </span><span class="cx"> self.runtest( </span><del>- select(["*"], or_(table1.c.id == 12, table1.c.id=='asdf', table1.c.id == 'foo')), </del><ins>+ select(["*"], or_(table1.c.myid == 12, table1.c.myid=='asdf', table1.c.myid == 'foo')), </ins><span class="cx"> "SELECT * FROM mytable WHERE mytable.myid = :mytable_myid OR mytable.myid = :mytable_myid_1 OR mytable.myid = :mytable_myid_2" </span><span class="cx"> ) </span><span class="cx"> </span><span class="cx"> def testorderby(self): </span><span class="cx"> self.runtest( </span><del>- table2.select(order_by = [table2.c.id, asc(table2.c.name)]), </del><ins>+ table2.select(order_by = [table2.c.otherid, asc(table2.c.othername)]), </ins><span class="cx"> "SELECT myothertable.otherid, myothertable.othername FROM myothertable ORDER BY myothertable.otherid, myothertable.othername ASC" </span><span class="cx"> ) </span><span class="cx"> def testgroupby(self): </span><span class="cx"> self.runtest( </span><del>- select([table2.c.name, func.count(table2.c.id)], group_by = [table2.c.name]), </del><ins>+ select([table2.c.othername, func.count(table2.c.otherid)], group_by = [table2.c.othername]), </ins><span class="cx"> "SELECT myothertable.othername, count(myothertable.otherid) FROM myothertable GROUP BY myothertable.othername" </span><span class="cx"> ) </span><span class="cx"> def testgroupby_and_orderby(self): </span><span class="cx"> self.runtest( </span><del>- select([table2.c.name, func.count(table2.c.id)], group_by = [table2.c.name], order_by = [table2.c.name]), </del><ins>+ select([table2.c.othername, func.count(table2.c.otherid)], group_by = [table2.c.othername], order_by = [table2.c.othername]), </ins><span class="cx"> "SELECT myothertable.othername, count(myothertable.otherid) FROM myothertable GROUP BY myothertable.othername ORDER BY myothertable.othername" </span><span class="cx"> ) </span><span class="cx"> def testalias(self): </span><span class="cx"> # test the alias for a table1. column names stay the same, table name "changes" to "foo". </span><span class="cx"> self.runtest( </span><del>- select([alias(table, 'foo')]) </del><ins>+ select([alias(table1, 'foo')]) </ins><span class="cx"> ,"SELECT foo.myid, foo.name, foo.description FROM mytable AS foo") </span><span class="cx"> </span><span class="cx"> # create a select for a join of two tables. use_labels means the column names will have </span><span class="cx"> # labels tablename_columnname, which become the column keys accessible off the Selectable object. </span><span class="cx"> # also, only use one column from the second table and all columns from the first table1. </span><del>- q = select([table, table2.c.id], table1.c.id == table2.c.id, use_labels = True) </del><ins>+ q = select([table1, table2.c.otherid], table1.c.myid == table2.c.otherid, use_labels = True) </ins><span class="cx"> </span><span class="cx"> # make an alias of the "selectable". column names stay the same (i.e. the labels), table name "changes" to "t2view". </span><span class="cx"> a = alias(q, 't2view') </span><span class="lines">@@ -264,11 +255,11 @@ </span><span class="cx"> </span><span class="cx"> def testtextmix(self): </span><span class="cx"> self.runtest(select( </span><del>- [table, table2.c.id, "sysdate()", "foo, bar, lala"], </del><ins>+ [table1, table2.c.otherid, "sysdate()", "foo, bar, lala"], </ins><span class="cx"> and_( </span><span class="cx"> "foo.id = foofoo(lala)", </span><span class="cx"> "datetime(foo) = Today", </span><del>- table1.c.id == table2.c.id, </del><ins>+ table1.c.myid == table2.c.otherid, </ins><span class="cx"> ) </span><span class="cx"> ), </span><span class="cx"> "SELECT mytable.myid, mytable.name, mytable.description, myothertable.otherid, sysdate(), foo, bar, lala \ </span><span class="lines">@@ -276,39 +267,39 @@ </span><span class="cx"> </span><span class="cx"> def testtextualsubquery(self): </span><span class="cx"> self.runtest(select( </span><del>- [alias(table, 't'), "foo.f"], </del><ins>+ [alias(table1, 't'), "foo.f"], </ins><span class="cx"> "foo.f = t.id", </span><span class="cx"> from_obj = ["(select f from bar where lala=heyhey) foo"] </span><span class="cx"> ), </span><span class="cx"> "SELECT t.myid, t.name, t.description, foo.f FROM mytable AS t, (select f from bar where lala=heyhey) foo WHERE foo.f = t.id") </span><span class="cx"> </span><span class="cx"> def testliteral(self): </span><del>- self.runtest(select([literal("foo") + literal("bar")], from_obj=[table]), </del><ins>+ self.runtest(select([literal("foo") + literal("bar")], from_obj=[table1]), </ins><span class="cx"> "SELECT :literal + :literal_1 FROM mytable", engine=db) </span><span class="cx"> </span><span class="cx"> def testfunction(self): </span><del>- self.runtest(func.lala(3, 4, literal("five"), table1.c.id) * table2.c.id, </del><ins>+ self.runtest(func.lala(3, 4, literal("five"), table1.c.myid) * table2.c.otherid, </ins><span class="cx"> "lala(:lala, :lala_1, :literal, mytable.myid) * myothertable.otherid", engine=db) </span><span class="cx"> </span><span class="cx"> def testjoin(self): </span><span class="cx"> self.runtest( </span><del>- join(table2, table, table1.c.id == table2.c.id).select(), </del><ins>+ join(table2, table1, table1.c.myid == table2.c.otherid).select(), </ins><span class="cx"> "SELECT myothertable.otherid, myothertable.othername, mytable.myid, mytable.name, \ </span><span class="cx"> mytable.description FROM myothertable JOIN mytable ON mytable.myid = myothertable.otherid" </span><span class="cx"> ) </span><span class="cx"> </span><span class="cx"> self.runtest( </span><span class="cx"> select( </span><del>- [table], - from_obj = [join(table, table2, table1.c.id == table2.c.id)] </del><ins>+ [table1], + from_obj = [join(table1, table2, table1.c.myid == table2.c.otherid)] </ins><span class="cx"> ), </span><span class="cx"> "SELECT mytable.myid, mytable.name, mytable.description FROM mytable JOIN myothertable ON mytable.myid = myothertable.otherid") </span><span class="cx"> </span><span class="cx"> self.runtest( </span><span class="cx"> select( </span><del>- [join(join(table, table2, table1.c.id == table2.c.id), table3, table1.c.id == table3.c.id) </del><ins>+ [join(join(table1, table2, table1.c.myid == table2.c.otherid), table3, table1.c.myid == table3.c.userid) </ins><span class="cx"> ]), </span><del>- "SELECT mytable.myid, mytable.name, mytable.description, myothertable.otherid, myothertable.othername, thirdtable1.userid, thirdtable1.otherstuff FROM mytable JOIN myothertable ON mytable.myid = myothertable.otherid JOIN thirdtable ON mytable.myid = thirdtable1.userid" </del><ins>+ "SELECT mytable.myid, mytable.name, mytable.description, myothertable.otherid, myothertable.othername, thirdtable.userid, thirdtable.otherstuff FROM mytable JOIN myothertable ON mytable.myid = myothertable.otherid JOIN thirdtable ON mytable.myid = thirdtable.userid" </ins><span class="cx"> ) </span><span class="cx"> </span><span class="cx"> self.runtest( </span><span class="lines">@@ -320,24 +311,24 @@ </span><span class="cx"> self.runtest( </span><span class="cx"> select([table, table2, table3], </span><span class="cx"> </span><del>- from_obj = [join(table, table2, table1.c.id == table2.c.id).outerjoin(table3, table1.c.id==table3.c.id)] </del><ins>+ from_obj = [join(table, table2, table1.c.myid == table2.c.otherid).outerjoin(table3, table1.c.myid==table3.c.userid)] </ins><span class="cx"> </span><del>- #from_obj = [outerjoin(join(table, table2, table1.c.id == table2.c.id), table3, table1.c.id==table3.c.id)] </del><ins>+ #from_obj = [outerjoin(join(table, table2, table1.c.myid == table2.c.otherid), table3, table1.c.myid==table3.c.userid)] </ins><span class="cx"> ) </span><span class="cx"> ,"SELECT mytable.myid, mytable.name, mytable.description, myothertable.otherid, myothertable.othername, thirdtable1.userid, thirdtable1.otherstuff FROM mytable JOIN myothertable ON mytable.myid = myothertable.otherid LEFT OUTER JOIN thirdtable ON mytable.myid = thirdtable1.userid" </span><span class="cx"> ) </span><span class="cx"> self.runtest( </span><span class="cx"> select([table, table2, table3], </span><del>- from_obj = [outerjoin(table, join(table2, table3, table2.c.id == table3.c.id), table1.c.id==table2.c.id)] </del><ins>+ from_obj = [outerjoin(table, join(table2, table3, table2.c.otherid == table3.c.userid), table1.c.myid==table2.c.otherid)] </ins><span class="cx"> ) </span><span class="cx"> ,"SELECT mytable.myid, mytable.name, mytable.description, myothertable.otherid, myothertable.othername, thirdtable1.userid, thirdtable1.otherstuff FROM mytable LEFT OUTER JOIN (myothertable JOIN thirdtable ON myothertable.otherid = thirdtable1.userid) ON mytable.myid = myothertable.otherid" </span><span class="cx"> ) </span><span class="cx"> </span><span class="cx"> def testunion(self): </span><span class="cx"> x = union( </span><del>- select([table], table1.c.id == 5), - select([table], table1.c.id == 12), - order_by = [table1.c.id], </del><ins>+ select([table], table1.c.myid == 5), + select([table], table1.c.myid == 12), + order_by = [table1.c.myid], </ins><span class="cx"> ) </span><span class="cx"> </span><span class="cx"> self.runtest(x, "SELECT mytable.myid, mytable.name, mytable.description \ </span><span class="lines">@@ -367,11 +358,11 @@ </span><span class="cx"> [table, table2], </span><span class="cx"> and_( </span><span class="cx"> table1.c.name == 'fred', </span><del>- table1.c.id == 10, - table2.c.name != 'jack', </del><ins>+ table1.c.myid == 10, + table2.c.othername != 'jack', </ins><span class="cx"> "EXISTS (select yay from foo where boo = lar)" </span><span class="cx"> ), </span><del>- from_obj = [ outerjoin(table, table2, table1.c.id == table2.c.id) ] </del><ins>+ from_obj = [ outerjoin(table, table2, table1.c.myid == table2.c.otherid) ] </ins><span class="cx"> ) </span><span class="cx"> </span><span class="cx"> self.runtest(query, </span><span class="lines">@@ -393,7 +384,7 @@ </span><span class="cx"> def testbindparam(self): </span><span class="cx"> self.runtest(select( </span><span class="cx"> [table, table2], </span><del>- and_(table1.c.id == table2.c.id, </del><ins>+ and_(table1.c.myid == table2.c.otherid, </ins><span class="cx"> table1.c.name == bindparam('mytablename'), </span><span class="cx"> ) </span><span class="cx"> ), </span><span class="lines">@@ -403,23 +394,23 @@ </span><span class="cx"> </span><span class="cx"> # check that the bind params sent along with a compile() call </span><span class="cx"> # get preserved when the params are retreived later </span><del>- s = select([table], table1.c.id == bindparam('test')) </del><ins>+ s = select([table], table1.c.myid == bindparam('test')) </ins><span class="cx"> c = s.compile(parameters = {'test' : 7}) </span><span class="cx"> self.assert_(c.get_params() == {'test' : 7}) </span><span class="cx"> </span><span class="cx"> def testcorrelatedsubquery(self): </span><span class="cx"> self.runtest( </span><del>- table1.select(table1.c.id == select([table2.c.id], table1.c.name == table2.c.name)), </del><ins>+ table1.select(table1.c.myid == select([table2.c.otherid], table1.c.name == table2.c.othername)), </ins><span class="cx"> "SELECT mytable.myid, mytable.name, mytable.description FROM mytable WHERE mytable.myid = (SELECT myothertable.otherid AS id FROM myothertable WHERE mytable.name = myothertable.othername)" </span><span class="cx"> ) </span><span class="cx"> </span><span class="cx"> self.runtest( </span><del>- table1.select(exists([1], table2.c.id == table1.c.id)), </del><ins>+ table1.select(exists([1], table2.c.otherid == table1.c.myid)), </ins><span class="cx"> "SELECT mytable.myid, mytable.name, mytable.description FROM mytable WHERE EXISTS (SELECT 1 FROM myothertable WHERE myothertable.otherid = mytable.myid)" </span><span class="cx"> ) </span><span class="cx"> </span><span class="cx"> talias = table1.alias('ta') </span><del>- s = subquery('sq2', [talias], exists([1], table2.c.id == talias.c.id)) </del><ins>+ s = subquery('sq2', [talias], exists([1], table2.c.otherid == talias.c.id)) </ins><span class="cx"> self.runtest( </span><span class="cx"> select([s, table]) </span><span class="cx"> ,"SELECT sq2.id, sq2.name, sq2.description, mytable.myid, mytable.name, mytable.description FROM (SELECT ta.myid AS id, ta.name AS name, ta.description AS description FROM mytable AS ta WHERE EXISTS (SELECT 1 FROM myothertable WHERE myothertable.otherid = ta.myid)) AS sq2, mytable") </span><span class="lines">@@ -430,10 +421,10 @@ </span><span class="cx"> """SELECT users.user_id, users.user_name, users.password, s.street FROM users, (SELECT addresses.street AS street FROM addresses WHERE addresses.user_id = users.user_id) AS s""") </span><span class="cx"> </span><span class="cx"> def testin(self): </span><del>- self.runtest(select([table], table1.c.id.in_(1, 2, 3)), </del><ins>+ self.runtest(select([table], table1.c.myid.in_(1, 2, 3)), </ins><span class="cx"> "SELECT mytable.myid, mytable.name, mytable.description FROM mytable WHERE mytable.myid IN (:mytable_myid, :mytable_myid_1, :mytable_myid_2)") </span><span class="cx"> </span><del>- self.runtest(select([table], table1.c.id.in_(select([table2.c.id]))), </del><ins>+ self.runtest(select([table], table1.c.myid.in_(select([table2.c.otherid]))), </ins><span class="cx"> "SELECT mytable.myid, mytable.name, mytable.description FROM mytable WHERE mytable.myid IN (SELECT myothertable.otherid AS id FROM myothertable)") </span><span class="cx"> </span><span class="cx"> def testlateargs(self): </span><span class="lines">@@ -454,7 +445,7 @@ </span><span class="cx"> # insert with user-supplied bind params for specific columns, </span><span class="cx"> # cols provided literally </span><span class="cx"> self.runtest( </span><del>- insert(table, {table1.c.id : bindparam('userid'), table1.c.name : bindparam('username')}), </del><ins>+ insert(table, {table1.c.myid : bindparam('userid'), table1.c.name : bindparam('username')}), </ins><span class="cx"> "INSERT INTO mytable (myid, name) VALUES (:userid, :username)") </span><span class="cx"> </span><span class="cx"> # insert with user-supplied bind params for specific columns, cols </span><span class="lines">@@ -472,13 +463,13 @@ </span><span class="cx"> ) </span><span class="cx"> </span><span class="cx"> def testupdate(self): </span><del>- self.runtest(update(table, table1.c.id == 7), "UPDATE mytable SET name=:name WHERE mytable.myid = :mytable_myid", params = {table1.c.name:'fred'}) - self.runtest(update(table, table1.c.id == 7), "UPDATE mytable SET name=:name WHERE mytable.myid = :mytable_myid", params = {'name':'fred'}) - self.runtest(update(table, values = {table1.c.name : table1.c.id}), "UPDATE mytable SET name=mytable.myid") </del><ins>+ self.runtest(update(table, table1.c.myid == 7), "UPDATE mytable SET name=:name WHERE mytable.myid = :mytable_myid", params = {table1.c.name:'fred'}) + self.runtest(update(table, table1.c.myid == 7), "UPDATE mytable SET name=:name WHERE mytable.myid = :mytable_myid", params = {'name':'fred'}) + self.runtest(update(table, values = {table1.c.name : table1.c.myid}), "UPDATE mytable SET name=mytable.myid") </ins><span class="cx"> self.runtest(update(table, whereclause = table1.c.name == bindparam('crit'), values = {table1.c.name : 'hi'}), "UPDATE mytable SET name=:name WHERE mytable.name = :crit", params = {'crit' : 'notthere'}) </span><del>- self.runtest(update(table, table1.c.id == 12, values = {table1.c.name : table1.c.id}), "UPDATE mytable SET name=mytable.myid, description=:description WHERE mytable.myid = :mytable_myid", params = {'description':'test'}) - self.runtest(update(table, table1.c.id == 12, values = {table1.c.id : 9}), "UPDATE mytable SET myid=:myid, description=:description WHERE mytable.myid = :mytable_myid", params = {'mytable_myid': 12, 'myid': 9, 'description': 'test'}) - s = table1.update(table1.c.id == 12, values = {table1.c.name : 'lala'}) </del><ins>+ self.runtest(update(table, table1.c.myid == 12, values = {table1.c.name : table1.c.myid}), "UPDATE mytable SET name=mytable.myid, description=:description WHERE mytable.myid = :mytable_myid", params = {'description':'test'}) + self.runtest(update(table, table1.c.myid == 12, values = {table1.c.myid : 9}), "UPDATE mytable SET myid=:myid, description=:description WHERE mytable.myid = :mytable_myid", params = {'mytable_myid': 12, 'myid': 9, 'description': 'test'}) + s = table1.update(table1.c.myid == 12, values = {table1.c.name : 'lala'}) </ins><span class="cx"> print str(s) </span><span class="cx"> c = s.compile(parameters = {'mytable_id':9,'name':'h0h0'}) </span><span class="cx"> print str(c) </span><span class="lines">@@ -486,11 +477,11 @@ </span><span class="cx"> </span><span class="cx"> def testupdateexpression(self): </span><span class="cx"> self.runtest(update(table, </span><del>- (table1.c.id == func.hoho(4)) & </del><ins>+ (table1.c.myid == func.hoho(4)) & </ins><span class="cx"> (table1.c.name == literal('foo') + table1.c.name + literal('lala')), </span><span class="cx"> values = { </span><span class="cx"> table1.c.name : table1.c.name + "lala", </span><del>- table1.c.id : func.do_stuff(table1.c.id, literal('hoho')) </del><ins>+ table1.c.myid : func.do_stuff(table1.c.myid, literal('hoho')) </ins><span class="cx"> }), "UPDATE mytable SET myid=(do_stuff(mytable.myid, :literal_2)), name=(mytable.name + :mytable_name) WHERE mytable.myid = hoho(:hoho) AND mytable.name = :literal + mytable.name + :literal_1") </span><span class="cx"> </span><span class="cx"> def testcorrelatedupdate(self): </span><span class="lines">@@ -499,12 +490,12 @@ </span><span class="cx"> self.runtest(u, "UPDATE mytable SET name=(select name from mytable where id=mytable.id)") </span><span class="cx"> </span><span class="cx"> # test against a regular constructed subquery </span><del>- s = select([table2], table2.c.id == table1.c.id) </del><ins>+ s = select([table2], table2.c.otherid == table1.c.myid) </ins><span class="cx"> u = update(table, table1.c.name == 'jack', values = {table1.c.name : s}) </span><span class="cx"> self.runtest(u, "UPDATE mytable SET name=(SELECT myothertable.otherid, myothertable.othername FROM myothertable WHERE myothertable.otherid = mytable.myid) WHERE mytable.name = :mytable_name") </span><span class="cx"> </span><span class="cx"> def testdelete(self): </span><del>- self.runtest(delete(table, table1.c.id == 7), "DELETE FROM mytable WHERE mytable.myid = :mytable_myid") </del><ins>+ self.runtest(delete(table, table1.c.myid == 7), "DELETE FROM mytable WHERE mytable.myid = :mytable_myid") </ins><span class="cx"> </span><span class="cx"> class SchemaTest(SQLTest): </span><span class="cx"> def testselect(self): </span></span></pre> </div> </div> </body> </html> |