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) else: br_fkey = None return create_backref(self.backref, foreignkey=br_fkey, uselist=False)
def create_backref(self, klass): if self.backref is None: return None relclass = ActiveMapperMeta.classes[self.classname] if klass.__name__ == self.classname: class_mapper(relclass).compile() br_fkey = relclass.c[self.colname] else: br_fkey = None return create_backref(self.backref, remote_side=br_fkey)