Пример #1
0
 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)
Пример #2
0
    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)
Пример #3
0
    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)
Пример #4
0
 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)