]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
comment
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 7 Mar 2006 03:17:34 +0000 (03:17 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 7 Mar 2006 03:17:34 +0000 (03:17 +0000)
lib/sqlalchemy/mapping/properties.py

index ba77d3f4cf4e1345b1ce629f3c6ada4b7272c041..183cf97f628269b235e723f437bea5b9bde28cae 100644 (file)
@@ -806,12 +806,14 @@ class GenericOption(MapperOption):
         mapper.set_property(key, class_(**kwargs ))
 
 class BackRef(object):
-    """stores the name of a backreference property as well as a relation (PropertyLoader),
-    used to construct more customized backrefs"""
+    """stores the name of a backreference property as well as options to 
+    be used on the resulting PropertyLoader."""
     def __init__(self, key, **kwargs):
         self.key = key
         self.kwargs = kwargs
     def compile(self, prop):
+        """called by the owning PropertyLoader to set up a backreference on the
+        PropertyLoader's mapper."""
         # try to set a LazyLoader on our mapper referencing the parent mapper
         if not prop.mapper.props.has_key(self.key):
             if prop.secondaryjoin is not None:
@@ -833,8 +835,8 @@ class BackRef(object):
             # else set one of us as the "backreference"
             if not prop.mapper.props[self.key].is_backref:
                 prop.is_backref=True
-        
     def get_extension(self):
+        """returns an attribute extension to use with this backreference."""
         return attributes.GenericBackrefExtension(self.key)
         
 class EagerLazyOption(GenericOption):