[Sqlalchemy-commits] [1139] sqlalchemy/trunk: more notes, docs
Brought to you by:
zzzeek
From: <co...@sq...> - 2006-03-13 17:32:22
|
<!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>[1139] sqlalchemy/trunk: more notes, docs</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>1139</dd> <dt>Author</dt> <dd>zzzeek</dd> <dt>Date</dt> <dd>2006-03-13 11:32:13 -0600 (Mon, 13 Mar 2006)</dd> </dl> <h3>Log Message</h3> <pre>more notes, docs</pre> <h3>Modified Paths</h3> <ul> <li><a href="#sqlalchemytrunkCHANGES">sqlalchemy/trunk/CHANGES</a></li> <li><a href="#sqlalchemytrunkdocbuildcontentdatamappingmyt">sqlalchemy/trunk/doc/build/content/datamapping.myt</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="sqlalchemytrunkCHANGES"></a> <div class="modfile"><h4>Modified: sqlalchemy/trunk/CHANGES (1138 => 1139)</h4> <pre class="diff"><span> <span class="info">--- sqlalchemy/trunk/CHANGES 2006-03-13 17:18:03 UTC (rev 1138) +++ sqlalchemy/trunk/CHANGES 2006-03-13 17:32:13 UTC (rev 1139) </span><span class="lines">@@ -1,5 +1,6 @@ </span><span class="cx"> 0.1.4 </span><del>-- create_engine() now uses genericized parameters; host/hostname, db/dbname/database, password/passwd, etc. for all engine connections. makes engine URIs much more "universal" </del><ins>+- create_engine() now uses genericized parameters; host/hostname, db/dbname/database, +password/passwd, etc. for all engine connections. makes engine URIs much more "universal" </ins><span class="cx"> - added support for SELECT statements embedded into a column clause, using the flag </span><span class="cx"> "scalar=True" </span><span class="cx"> - another overhaul to EagerLoading when used in conjunction with mappers that </span><span class="lines">@@ -13,8 +14,8 @@ </span><span class="cx"> exception. also adds selectfirst_by (synonymous with get_by) and selectone_by </span><span class="cx"> - added onupdate parameter to Column, will exec SQL/python upon an update </span><span class="cx"> statement.Also adds "for_update=True" to all DefaultGenerator subclasses </span><del>-- added user-contributed support for Oracle table reflection; still -some bugs to work out regarding composite primary keys/dictionary selection </del><ins>+- added support for Oracle table reflection contributed by Andrija Zaric; +still some bugs to work out regarding composite primary keys/dictionary selection </ins><span class="cx"> - checked in an initial Firebird module, awaiting testing. </span><span class="cx"> - added sql.ClauseParameters dictionary object as the result for </span><span class="cx"> compiled.get_params(), does late-typeprocessing of bind parameters so </span><span class="lines">@@ -27,6 +28,19 @@ </span><span class="cx"> - added 'encoding="utf8"' parameter to engine. the given encoding will be </span><span class="cx"> used for all encode/decode calls within Unicode types as well as Strings </span><span class="cx"> when convert_unicode=True. </span><ins>+- improved support for mapping against UNIONs, added polymorph.py example +to illustrate multi-class mapping against a UNION +- fix to SQLite LIMIT/OFFSET syntax +- fix to Oracle LIMIT syntax +- added backref() function, allows backreferences to have keyword arguments +that will be passed to the backref. +- Sequences and ColumnDefault objects can do execute()/scalar() standalone +- SQL functions (i.e. func.foo()) can do execute()/scalar() standalone +- fix to SQL functions so that the ANSI-standard functions, i.e. current_timestamp +etc., do not specify parenthesis. all other functions do. +- added settattr_clean and append_clean to SmartProperty, which set +attributes without triggering a "dirty" event or any history. used as: +myclass.prop1.setattr_clean(myobject, 'hi') </ins><span class="cx"> - improved support to column defaults when used by mappers; mappers will pull </span><span class="cx"> pre-executed defaults from statement's executed bind parameters </span><span class="cx"> (pre-conversion) to populate them into a saved object's attributes; if any </span><span class="lines">@@ -37,6 +51,12 @@ </span><span class="cx"> - improvements to SQL func calls including an "engine" keyword argument so </span><span class="cx"> they can be execute()d or scalar()ed standalone, also added func accessor to </span><span class="cx"> SQLEngine </span><ins>+- fix to MySQL4 custom table engines, i.e. TYPE instead of ENGINE +- slightly enhanced logging, includes timestamps and a somewhat configurable +formatting system, in lieu of a full-blown logging system +- improvements to the ActiveMapper class from the TG gang, including +many-to-many relationships +- added Double and TinyInt support to mysql </ins><span class="cx"> </span><span class="cx"> 0.1.3 </span><span class="cx"> - completed "post_update" feature, will add a second update statement before </span></span></pre></div> <a id="sqlalchemytrunkdocbuildcontentdatamappingmyt"></a> <div class="modfile"><h4>Modified: sqlalchemy/trunk/doc/build/content/datamapping.myt (1138 => 1139)</h4> <pre class="diff"><span> <span class="info">--- sqlalchemy/trunk/doc/build/content/datamapping.myt 2006-03-13 17:18:03 UTC (rev 1138) +++ sqlalchemy/trunk/doc/build/content/datamapping.myt 2006-03-13 17:32:13 UTC (rev 1139) </span><span class="lines">@@ -343,19 +343,14 @@ </span><span class="cx"> True </span><span class="cx"> </&> </span><span class="cx"> </span><del>-+<p>The backreference feature also works with many-to-many relationships, which are described later. When creating a backreference, a corresponding property is placed on the child mapper. This property can be overridden with a custom property using the <span class="codeline">add_property</span> function: </del><ins>++<p>The backreference feature also works with many-to-many relationships, which are described later. When creating a backreference, a corresponding property is placed on the child mapper. The default arguments to this property can be overridden using the <span class="codeline">backref()</span> function: </ins><span class="cx"> <&|formatting.myt:code&> </span><span class="cx"> Address.mapper = mapper(Address, addresses) </span><span class="cx"> </span><span class="cx"> User.mapper = mapper(User, users, properties = { </span><del>- 'addresses' : relation(Address.mapper, backref='user') </del><ins>+ 'addresses' : relation(Address.mapper, backref=backref('user', lazy=False, private=True)) </ins><span class="cx"> } </span><span class="cx"> ) </span><del>- - Address.mapper.add_property('user', relation( - User.mapper, lazy=False, private=True, backref='addresses' - )) - </del><span class="cx"> </&> </span><span class="cx"> <p>Note that when overriding a backreferenced property, we re-specify the backreference as well. This will not override the existing 'addresses' property on the User class, but just sends a message to the attribute-management system that it should continue to maintain this backreference.</p> </span><span class="cx"> </&> </span></span></pre> </div> </div> </body> </html> |