summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext/activemapper.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-06-06 01:33:17 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-06-06 01:33:17 +0000
commit01e8c1e7420dac6b3e71a1fd3b981f97bddc588f (patch)
tree790d5de32e7caf7d550fbd2ef657950f53bb65bd /lib/sqlalchemy/ext/activemapper.py
parentbdb41655d14caed41e93225f79e5554925a15e20 (diff)
downloadsqlalchemy-01e8c1e7420dac6b3e71a1fd3b981f97bddc588f.tar.gz
fix to backref when its none for one-to-one
Diffstat (limited to 'lib/sqlalchemy/ext/activemapper.py')
-rw-r--r--lib/sqlalchemy/ext/activemapper.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/ext/activemapper.py b/lib/sqlalchemy/ext/activemapper.py
index aa71471d2..4ff7a150b 100644
--- a/lib/sqlalchemy/ext/activemapper.py
+++ b/lib/sqlalchemy/ext/activemapper.py
@@ -62,7 +62,9 @@ class one_to_many(relationship):
class one_to_one(relationship):
def __init__(self, classname, colname=None, backref=None, private=False, lazy=True):
- relationship.__init__(self, classname, colname, create_backref(backref, uselist=False), private, lazy, uselist=False)
+ if backref is not None:
+ backref = create_backref(backref, uselist=False)
+ relationship.__init__(self, classname, colname, backref, private, lazy, uselist=False)
class many_to_many(relationship):
def __init__(self, classname, secondary, backref=None, lazy=True):