On Feb 23, 2012, at 10:47 AM, lars van gemerden wrote:

> OK, thanks, the order wasn't the problem, I am using this for the
> initialization of my classes:
> 
>    dicty= {'__tablename__': name,
>           'id': Column(Integer, ForeignKey(basename + '.id'),
> primary_key = True),
>           '__mapper_args__': {'polymorphic_identity': name,
> 'inherit_condition': (id == classes[basename].id)}}
> 
> and as you said 'id' in the last line refers to the id() function. I
> think I fixed it by changing the code to:
> 
>    id_ = Column(Integer, ForeignKey(basename + '.id'), primary_key =
> True)
>    out = {'__tablename__': name,
>           'id': id_,
>           '__mapper_args__': {'polymorphic_identity': name,
> 'inherit_condition': (id_ == classes[basename].id)}}
> 
> But I am getting a (maybe unrelated) error. Should this solution work?

that approach seems fine though classes[basename] must be already established, 
I might pull it just from the superclass that you're passing into type().

-- 
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.

Reply via email to