...... etc
One other thing i noted which is really odd....I have multiple classes inheriting from BaseClass, which is why I have set up polymorphic inheritance in the foist place.When I do:alldata = s.query(BaseClass).all()for a in alldata:print a.ExtModel()I notice that BaseClass.__table__.columns sometimes holds the Id in others it doesnt.
most of the classes (new project) are "empty" anyway and are no more than:SomeClass(BaseClass):Id = Column(Integer, ForeignKey('baseclass.Id'), primary_key=True)SomeClass2(BaseClass):Id = Column(Integer, ForeignKey('baseclass.Id'), primary_key=True)That is really weird!!!!! It solves my problem automatically on some instances but not on others and only for the Id column .......
Is there a way I can make a new ColumnList based on the self.__table__.columns and BaseClass.__tablename__ excluding the overlap. In this example I 'only' talk about the Id but in my real world there are more Columns in BaseClass
Martijn--
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To post to this group, send email to sqlal...@googlegroups.com.
To unsubscribe from this group, send email to sqlalchemy+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
One other thing i noted which is really odd....I have multiple classes inheriting from BaseClass, which is why I have set up polymorphic inheritance in the foist place.When I do:alldata = s.query(BaseClass).all()for a in alldata:print a.ExtModel()I notice that BaseClass.__table__.columns sometimes holds the Id in others it doesnt.i don't understand what "sometimes" means. BaseClass.__table__.columns is a collection created only once.
most of the classes (new project) are "empty" anyway and are no more than:SomeClass(BaseClass):Id = Column(Integer, ForeignKey('baseclass.Id'), primary_key=True)SomeClass2(BaseClass):Id = Column(Integer, ForeignKey('baseclass.Id'), primary_key=True)That is really weird!!!!! It solves my problem automatically on some instances but not on others and only for the Id column .......Is there a way I can make a new ColumnList based on the self.__table__.columns and BaseClass.__tablename__ excluding the overlap. In this example I 'only' talk about the Id but in my real world there are more Columns in BaseClassi dunno, [c for c in self.__table__.columns] + [c for c in BaseClass.__table__.columns if c.key not in self.__table__.columns] ?
Martijn