]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
fix to backref when its none for one-to-one
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 6 Jun 2006 01:33:17 +0000 (01:33 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 6 Jun 2006 01:33:17 +0000 (01:33 +0000)
lib/sqlalchemy/ext/activemapper.py

index aa71471d2117f5235a7a840493f0676fd00bf073..4ff7a150b6e55f7d2e067f91765e6507c535b9c3 100644 (file)
@@ -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):