diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-07-10 01:06:31 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-07-10 01:06:31 +0000 |
commit | 55917950d60a4a3dd26e237231fe499c149368c6 (patch) | |
tree | 73b90266de542e3136e298571fa3ddd6d3909213 /lib/sqlalchemy/ext/activemapper.py | |
parent | 5c7993080a93dc142057a4ac05501bcb3291731d (diff) | |
download | sqlalchemy-55917950d60a4a3dd26e237231fe499c149368c6.tar.gz |
works without backrefs too....
Diffstat (limited to 'lib/sqlalchemy/ext/activemapper.py')
-rw-r--r-- | lib/sqlalchemy/ext/activemapper.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sqlalchemy/ext/activemapper.py b/lib/sqlalchemy/ext/activemapper.py index a0984f46c..6c6886c66 100644 --- a/lib/sqlalchemy/ext/activemapper.py +++ b/lib/sqlalchemy/ext/activemapper.py @@ -76,6 +76,8 @@ class relationship(object): uselist=self.uselist, order_by=self.order_by) def create_backref(self, klass): + if self.backref is None: + return None relclass = ActiveMapperMeta.classes[self.classname] if klass.__name__ == self.classname: br_fkey = getattr(relclass.c, self.colname) @@ -95,6 +97,8 @@ class one_to_one(relationship): relationship.__init__(self, classname, colname, backref, private, lazy, uselist=False, order_by=order_by) def create_backref(self, klass): + if self.backref is None: + return None relclass = ActiveMapperMeta.classes[self.classname] if klass.__name__ == self.classname: br_fkey = getattr(relclass.c, self.colname) |