[Sqlalchemy-commits] [5247] sqlalchemy/branches/rel_0_4: - Fixed bug in composite types which preve
Brought to you by:
zzzeek
From: <co...@sq...> - 2008-11-05 21:16:15
|
<!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><meta http-equiv="content-type" content="text/html; charset=utf-8" /><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, #header, #footer { 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; } #header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; } #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>[5247] sqlalchemy/branches/rel_0_4: - Fixed bug in composite types which prevented a primary-key</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>5247</dd> <dt>Author</dt> <dd>zzzeek</dd> <dt>Date</dt> <dd>2008-11-05 16:16:09 -0500 (Wed, 05 Nov 2008)</dd> </dl> <h3>Log Message</h3> <pre>- Fixed bug in composite types which prevented a primary-key composite type from being mutated [ticket:1213].</pre> <h3>Modified Paths</h3> <ul> <li><a href="#sqlalchemybranchesrel_0_4CHANGES">sqlalchemy/branches/rel_0_4/CHANGES</a></li> <li><a href="#sqlalchemybranchesrel_0_4libsqlalchemyormmapperpy">sqlalchemy/branches/rel_0_4/lib/sqlalchemy/orm/mapper.py</a></li> <li><a href="#sqlalchemybranchesrel_0_4testormmapperpy">sqlalchemy/branches/rel_0_4/test/orm/mapper.py</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="sqlalchemybranchesrel_0_4CHANGES"></a> <div class="modfile"><h4>Modified: sqlalchemy/branches/rel_0_4/CHANGES (5246 => 5247)</h4> <pre class="diff"><span> <span class="info">--- sqlalchemy/branches/rel_0_4/CHANGES 2008-11-05 21:15:19 UTC (rev 5246) +++ sqlalchemy/branches/rel_0_4/CHANGES 2008-11-05 21:16:09 UTC (rev 5247) </span><span class="lines">@@ -15,6 +15,9 @@ </span><span class="cx"> reentrant mapper compile() calls, something that occurs when </span><span class="cx"> using declarative constructs inside of ForeignKey objects. </span><span class="cx"> Ported from 0.5. </span><ins>+ + - Fixed bug in composite types which prevented a primary-key + composite type from being mutated [ticket:1213]. </ins><span class="cx"> </span><span class="cx"> 0.4.8 </span><span class="cx"> ===== </span></span></pre></div> <a id="sqlalchemybranchesrel_0_4libsqlalchemyormmapperpy"></a> <div class="modfile"><h4>Modified: sqlalchemy/branches/rel_0_4/lib/sqlalchemy/orm/mapper.py (5246 => 5247)</h4> <pre class="diff"><span> <span class="info">--- sqlalchemy/branches/rel_0_4/lib/sqlalchemy/orm/mapper.py 2008-11-05 21:15:19 UTC (rev 5246) +++ sqlalchemy/branches/rel_0_4/lib/sqlalchemy/orm/mapper.py 2008-11-05 21:16:09 UTC (rev 5247) </span><span class="lines">@@ -1110,10 +1110,10 @@ </span><span class="cx"> params[col.key] = prop.get_col_value(col, added[0]) </span><span class="cx"> if col in pks: </span><span class="cx"> if deleted: </span><del>- params[col._label] = deleted[0] </del><ins>+ params[col._label] = prop.get_col_value(col, deleted[0]) </ins><span class="cx"> else: </span><span class="cx"> # row switch logic can reach us here </span><del>- params[col._label] = added[0] </del><ins>+ params[col._label] = prop.get_col_value(col, added[0]) </ins><span class="cx"> hasdata = True </span><span class="cx"> elif col in pks: </span><span class="cx"> params[col._label] = mapper._get_state_attr_by_column(state, col) </span></span></pre></div> <a id="sqlalchemybranchesrel_0_4testormmapperpy"></a> <div class="modfile"><h4>Modified: sqlalchemy/branches/rel_0_4/test/orm/mapper.py (5246 => 5247)</h4> <pre class="diff"><span> <span class="info">--- sqlalchemy/branches/rel_0_4/test/orm/mapper.py 2008-11-05 21:15:19 UTC (rev 5246) +++ sqlalchemy/branches/rel_0_4/test/orm/mapper.py 2008-11-05 21:16:09 UTC (rev 5247) </span><span class="lines">@@ -1293,6 +1293,11 @@ </span><span class="cx"> g2 = sess.query(Graph).get(Version(1, 1)) </span><span class="cx"> assert g.version == g2.version </span><span class="cx"> </span><ins>+ # test pk mutation + g2.version = Version(2, 1) + sess.flush() + g3 = sess.query(Graph).get(Version(2, 1)) + assert g2.version == g3.version </ins><span class="cx"> </span><span class="cx"> </span><span class="cx"> class NoLoadTest(MapperSuperTest): </span></span></pre> </div> </div> </body> </html> |