Commits

Mike Bayer  committed e8d9f08

still fixing compilation.....dum de dum.....

  • Participants
  • Parent commits 34315f7

Comments (0)

Files changed (3)

File lib/sqlalchemy/orm/mapper.py

         triggerset = _compile_triggers.pop(self.class_key, None)
         if triggerset is not None:
             for rec in triggerset:
-                print "looking at:", rec
                 rec.compiled(self.class_key)
                 if rec.can_compile():
                     rec.mapper._do_compile()
             # the column properties will attempt to be translated from the selectable unit
             # of the parent mapper to this mapper's selectable unit.
             self.inherits._inheriting_mappers.add(self)
-            for key, prop in self.inherits.props.iteritems():
+            for key, prop in self.inherits.__props.iteritems():
                 if not self.__props.has_key(key):
                     p = prop.copy()
                     if p.adapt(self):
                         props[key] = self.select_table.corresponding_column(prop)
                     elif (isinstance(prop, list) and sql.is_column(prop[0])):
                         props[key] = [self.select_table.corresponding_column(c) for c in prop]
-            self.__surrogate_mapper = Mapper(self.class_, self.select_table, non_primary=True, properties=props, polymorphic_map=self.polymorphic_map, polymorphic_on=self.select_table.corresponding_column(self.polymorphic_on))._do_compile()
+            self.__surrogate_mapper = Mapper(self.class_, self.select_table, non_primary=True, properties=props, polymorphic_map=self.polymorphic_map, polymorphic_on=self.select_table.corresponding_column(self.polymorphic_on))
 
     def _compile_class(self):
         """if this mapper is to be a primary mapper (i.e. the non_primary flag is not set),

File lib/sqlalchemy/orm/properties.py

     def do_init(self, key, parent):
         import sqlalchemy.orm
         if isinstance(self.argument, type):
-            self.mapper = mapper.class_mapper(self.argument)
+            self.mapper = mapper.class_mapper(self.argument, compile=False)._do_compile()
         else:
             self.mapper = self.argument._do_compile()
 
-        self.mapper = self.mapper.get_select_mapper()
+        self.mapper = self.mapper.get_select_mapper()._do_compile()
             
         if self.association is not None:
             if isinstance(self.association, type):
-                self.association = mapper.class_mapper(self.association)
+                self.association = mapper.class_mapper(self.association, compile=False)
         
         self.target = self.mapper.mapped_table
 

File lib/sqlalchemy/orm/query.py

         self.order_by = kwargs.pop('order_by', self.mapper.order_by)
         self.extension = kwargs.pop('extension', self.mapper.extension)
         self._session = session
-        if not hasattr(mapper, '_get_clause'):
+        if not hasattr(self.mapper, '_get_clause'):
             _get_clause = sql.and_()
             for primary_key in self.mapper.pks_by_table[self.table]:
                 _get_clause.clauses.append(primary_key == sql.bindparam("pk_"+primary_key._label, type=primary_key.type))