[Sqlalchemy-commits] [1109] sqlalchemy/trunk/lib/sqlalchemy/mapping/properties.py: comment
Brought to you by:
zzzeek
From: <co...@sq...> - 2006-03-07 03:17:42
|
<!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>[1109] sqlalchemy/trunk/lib/sqlalchemy/mapping/properties.py: comment</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>1109</dd> <dt>Author</dt> <dd>zzzeek</dd> <dt>Date</dt> <dd>2006-03-06 21:17:34 -0600 (Mon, 06 Mar 2006)</dd> </dl> <h3>Log Message</h3> <pre>comment</pre> <h3>Modified Paths</h3> <ul> <li><a href="#sqlalchemytrunklibsqlalchemymappingpropertiespy">sqlalchemy/trunk/lib/sqlalchemy/mapping/properties.py</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="sqlalchemytrunklibsqlalchemymappingpropertiespy"></a> <div class="modfile"><h4>Modified: sqlalchemy/trunk/lib/sqlalchemy/mapping/properties.py (1108 => 1109)</h4> <pre class="diff"><span> <span class="info">--- sqlalchemy/trunk/lib/sqlalchemy/mapping/properties.py 2006-03-07 03:16:10 UTC (rev 1108) +++ sqlalchemy/trunk/lib/sqlalchemy/mapping/properties.py 2006-03-07 03:17:34 UTC (rev 1109) </span><span class="lines">@@ -806,12 +806,14 @@ </span><span class="cx"> mapper.set_property(key, class_(**kwargs )) </span><span class="cx"> </span><span class="cx"> class BackRef(object): </span><del>- """stores the name of a backreference property as well as a relation (PropertyLoader), - used to construct more customized backrefs""" </del><ins>+ """stores the name of a backreference property as well as options to + be used on the resulting PropertyLoader.""" </ins><span class="cx"> def __init__(self, key, **kwargs): </span><span class="cx"> self.key = key </span><span class="cx"> self.kwargs = kwargs </span><span class="cx"> def compile(self, prop): </span><ins>+ """called by the owning PropertyLoader to set up a backreference on the + PropertyLoader's mapper.""" </ins><span class="cx"> # try to set a LazyLoader on our mapper referencing the parent mapper </span><span class="cx"> if not prop.mapper.props.has_key(self.key): </span><span class="cx"> if prop.secondaryjoin is not None: </span><span class="lines">@@ -833,8 +835,8 @@ </span><span class="cx"> # else set one of us as the "backreference" </span><span class="cx"> if not prop.mapper.props[self.key].is_backref: </span><span class="cx"> prop.is_backref=True </span><del>- </del><span class="cx"> def get_extension(self): </span><ins>+ """returns an attribute extension to use with this backreference.""" </ins><span class="cx"> return attributes.GenericBackrefExtension(self.key) </span><span class="cx"> </span><span class="cx"> class EagerLazyOption(GenericOption): </span></span></pre> </div> </div> </body> </html> |