That makes perfect sense.  I really appreciate the help.  Everything
is working as expected now.

On Aug 26, 12:42 pm, Michael Bayer <mike...@zzzcomputing.com> wrote:
> On Aug 26, 2011, at 1:34 PM, OlduvaiHand wrote:
>
> > Indeed.  I did mean to be using the case() function.  Thanks, zzzeek.
> > Incidentally, this particular case is supposed to return EnumSymbols
> > of the variety you describe in your EnumRecipe on techspot.  Now that
> > the correct case function is being used, I'm still getting a
> > "ProgrammingError: can't adapt type EnumSymbol" message.  You wouldn't
> > have any thoughts about that, would you?
>
> That indicates that an EnumSymbol object is being passed to a query as a 
> literal value, without typing information associated with it so that 
> SQLAlchemy doesn't know to associate your custom TypeDecorator with it.
>
> A phrase such as,   x == bindparam("y") , then passing {'y':some_enum_symbol} 
> as the parameters would have that effect.     The solution is to make sure 
> "type_=MyEnumType" is present on phrases like bindparam() or literal(), where 
> "MyEnumType" is the TypeDecorator used in the blog post.
>
> If OTOH this is a regular comparison, such as "myclass.my_enum_col == 
> some_enum", that should usually work OK unless my_enum_col doesn't have 
> proper typing information on it.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@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