Sorry for the double post but I forgot to ask the question! Is there a
way to do what I want and if not, is there something I should do
instead?

Thanks again,
Anthony

On Aug 5, 8:06 pm, anthony <anth...@yelp.com> wrote:
> Hi,
>
> First message here in the sqlalchemy mailing list. I was working with
> a previous version of sqlalchemy (0.6beta1) and while updating
> sqlalchemy, ran into a problem with polymorphic classes. Basically
> we're using a single table inheritance scheme and we want the "value"
> column to have different types. In the case of the example, the parent
> is A, and I wanted child B and C to interpret the "value" column of
> our table differently depending on the type. This worked in the
> previous version of but no longer works :(.
>
> class A(Base):
>         id = Column(Integer)
>         type = Column(Integer)
>         __mapper_args__ = {'polymorphic_on': type}
>
> class B(A):
>         __mapper_args = {'polymorphic_identity': 1}
>         value = Column(Integer)
>
> class C(A):
>         __mapper_args = {'polymorphic_identity': 2}
>         value = Column(Boolean)
>
> Thanks in advance!
> Anthony

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to