[Sqlalchemy-commits] [1134] sqlalchemy/trunk/doc/build/content: Fix typos, closing #89, #91, #92
Brought to you by:
zzzeek
From: <co...@sq...> - 2006-03-13 06:52:03
|
<!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>[1134] sqlalchemy/trunk/doc/build/content: Fix typos, closing #89, #91, #92</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>1134</dd> <dt>Author</dt> <dd>ash</dd> <dt>Date</dt> <dd>2006-03-13 00:51:47 -0600 (Mon, 13 Mar 2006)</dd> </dl> <h3>Log Message</h3> <pre>Fix typos, closing #89, #91, #92</pre> <h3>Modified Paths</h3> <ul> <li><a href="#sqlalchemytrunkdocbuildcontentsqlconstructionmyt">sqlalchemy/trunk/doc/build/content/sqlconstruction.myt</a></li> <li><a href="#sqlalchemytrunkdocbuildcontentunitofworkmyt">sqlalchemy/trunk/doc/build/content/unitofwork.myt</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="sqlalchemytrunkdocbuildcontentsqlconstructionmyt"></a> <div class="modfile"><h4>Modified: sqlalchemy/trunk/doc/build/content/sqlconstruction.myt (1133 => 1134)</h4> <pre class="diff"><span> <span class="info">--- sqlalchemy/trunk/doc/build/content/sqlconstruction.myt 2006-03-13 02:53:51 UTC (rev 1133) +++ sqlalchemy/trunk/doc/build/content/sqlconstruction.myt 2006-03-13 06:51:47 UTC (rev 1134) </span><span class="lines">@@ -582,7 +582,7 @@ </span><span class="cx"> s = select([users.c.user_id], users.c.user_name.like('p%')) </span><span class="cx"> </span><span class="cx"> # now select all addresses for those users </span><del>- <&formatting.myt:poplink&>addresses.select(addresses.c.address_id.in_(s)).execute() </del><ins>+ <&formatting.myt:poplink&>addresses.select(addresses.c.user_id.in_(s)).execute() </ins><span class="cx"> <&|formatting.myt:codepopper, link="sql" &> </span><span class="cx"> SELECT addresses.address_id, addresses.user_id, addresses.street, </span><span class="cx"> addresses.city, addresses.state, addresses.zip </span><span class="lines">@@ -901,9 +901,9 @@ </span><span class="cx"> # the generated SQL of the insert (i.e. what columns are present) </span><span class="cx"> # executemany() is used at the DBAPI level </span><span class="cx"> <&formatting.myt:poplink&>users.insert().execute( </span><del>- {'user_id':7, 'user_name':'jack', 'password':'asdfasdf'} - {'user_id':8, 'user_name':'ed', 'password':'asdffcadf'} - {'user_id':9, 'user_name':'fred', 'password':'asttf'} </del><ins>+ {'user_id':7, 'user_name':'jack', 'password':'asdfasdf'}, + {'user_id':8, 'user_name':'ed', 'password':'asdffcadf'}, + {'user_id':9, 'user_name':'fred', 'password':'asttf'}, </ins><span class="cx"> ) </span><span class="cx"> <&|formatting.myt:codepopper, link="sql" &> </span><span class="cx"> INSERT INTO users (user_id, user_name, password) </span></span></pre></div> <a id="sqlalchemytrunkdocbuildcontentunitofworkmyt"></a> <div class="modfile"><h4>Modified: sqlalchemy/trunk/doc/build/content/unitofwork.myt (1133 => 1134)</h4> <pre class="diff"><span> <span class="info">--- sqlalchemy/trunk/doc/build/content/unitofwork.myt 2006-03-13 02:53:51 UTC (rev 1133) +++ sqlalchemy/trunk/doc/build/content/unitofwork.myt 2006-03-13 06:51:47 UTC (rev 1134) </span><span class="lines">@@ -109,7 +109,7 @@ </span><span class="cx"> </&> </span><span class="cx"> </&> </span><span class="cx"> <&|doclib.myt:item, name="identity", description="The Identity Map" &> </span><del>- <p>All object instances which are saved to the database, or loaded from the database, are given an identity by the mapper/objectstore. This identity is available via the _identity_key property attached to each object instance, and is a tuple consisting of the table's class, the SQLAlchemy-specific "hash key" of the table its persisted to, and an additional tuple of primary key values, in the order that they appear within the table definition:</p> </del><ins>+ <p>All object instances which are saved to the database, or loaded from the database, are given an identity by the mapper/objectstore. This identity is available via the _instance_key property attached to each object instance, and is a tuple consisting of the table's class, the SQLAlchemy-specific "hash key" of the table its persisted to, and an additional tuple of primary key values, in the order that they appear within the table definition:</p> </ins><span class="cx"> <&|formatting.myt:code&> </span><span class="cx"> >>> obj._instance_key </span><span class="cx"> (<class 'test.tables.User'>, "Table('users',SQLiteSQLEngine(([':memory:'], {})),schema=None)", (7,)) </span><span class="lines">@@ -155,7 +155,7 @@ </span><span class="cx"> </&> </span><span class="cx"> </&> </span><span class="cx"> <&|doclib.myt:item, name="import", description="Bringing External Instances into the UnitOfWork" &> </span><del>- <p>The _identity_key attribute is designed to work with objects that are serialized into strings and brought back again. As it contains no references to internal structures or database connections, applications that use caches or session storage which require serialization (i.e. pickling) can store SQLAlchemy-loaded objects. However, as mentioned earlier, an object with a particular database identity is only allowed to exist uniquely within the current unit-of-work scope. So, upon deserializing such an object, it has to "check in" with the current unit-of-work/identity map combination, to insure that it is the only unique instance. This is achieved via the <span class="codeline">import_instance()</span> function in objectstore:</p> </del><ins>+ <p>The _instance_key attribute is designed to work with objects that are serialized into strings and brought back again. As it contains no references to internal structures or database connections, applications that use caches or session storage which require serialization (i.e. pickling) can store SQLAlchemy-loaded objects. However, as mentioned earlier, an object with a particular database identity is only allowed to exist uniquely within the current unit-of-work scope. So, upon deserializing such an object, it has to "check in" with the current unit-of-work/identity map combination, to insure that it is the only unique instance. This is achieved via the <span class="codeline">import_instance()</span> function in objectstore:</p> </ins><span class="cx"> <&|formatting.myt:code&> </span><span class="cx"> # deserialize an object </span><span class="cx"> myobj = pickle.loads(mystring) </span><span class="lines">@@ -164,7 +164,7 @@ </span><span class="cx"> # identity map, then you get back the one from the current session. </span><span class="cx"> myobj = objectstore.import_instance(myobj) </span><span class="cx"> </&> </span><del>-<p>Note that the import_instance() function will either mark the deserialized object as the official copy in the current identity map, which includes updating its _identity_key with the current application's class instance, or it will discard it and return the corresponding object that was already present.</p> </del><ins>+<p>Note that the import_instance() function will either mark the deserialized object as the official copy in the current identity map, which includes updating its _instance_key with the current application's class instance, or it will discard it and return the corresponding object that was already present.</p> </ins><span class="cx"> </&> </span><span class="cx"> </span><span class="cx"> <&|doclib.myt:item, name="advscope", description="Advanced UnitOfWork Management"&> </span></span></pre> </div> </div> </body> </html> |