On Jan 13, 2009, at 10:04 AM, Andreas Jung wrote:
> This fails:
>
> This is full-fledged mapper:
>
> class Arbeitsmittel(Base, AsDictMixin):
>
> __tablename__ = 'arbeitsmittel'
> __table_args__ = (
> { 'autoload' : True, })
>
> # column redefinitions needed for relation()s below
> idfassung = Column(Integer, ForeignKey('fassung.id'))
> format = Column(String, ForeignKey('format.format'))
> status = Column(Integer, ForeignKey('status.id'))
> idsachgebiet = Column(Integer, ForeignKey('sachgebiet.id'))
> idzielgruppe = Column(Integer, ForeignKey('zielgruppen.id'))
> idgattung = Column(Integer, ForeignKey('gattung.id'))
> styleguide_compliant = Column(Integer,
> ForeignKey('styleguide_compliant.id'))
>
> The minimal mapper looks like this:
>
> class ArbeitsmittelMinimal(Base, AsDictMixin):
> __table__ = Arbeitsmittel.__table__
> hidx = Column(String, primary_key=True)
>
declarative isn't nearly that smart. when you say __table__ =
something, thats the table to be mapped. any Column definitions below
that aren't used (actually, its trying to raise an error and that's
the part which is failing, ill fix that). Your second mapper is
mapping the full table just like the first one, so you really mean to
say:
class MySecondClass(...):
__table__ = MyFirstClass.__table__
__mapper_args__ = {'include_properties':['hidx']}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---