I'm trying to define a column_property including a cast expression,  but am
running into the following error:

    >>> import sqlalchemy
    >>> sqlalchemy.__version__
    '0.5.2'

    >>> from sqlalchemy import *
    >>> from sqlalchemy.orm import relation, column_property, sessionmaker

    >>> from sqlalchemy.ext.declarative import declarative_base
    >>> Base = declarative_base()
    >>> Session = sessionmaker()

    >>> class Order(Base):
    ...    __tablename__ = "orders"
    ...
    ...    id = Column(Integer, primary_key = True)
    ...
    ...    test = column_property(select([cast(1,
Numeric(14,2))]).label("test"))
    Traceback (most recent call last):
        ...
      File
"/usr/lib/python2.5/site-packages/SQLAlchemy-0.5.2-py2.5.egg/sqlalchemy/sql/visitors.py",
line 50, in _compiler_dispatch
        return getter(visitor)(self, **kw)
      File
"/usr/lib/python2.5/site-packages/SQLAlchemy-0.5.2-py2.5.egg/sqlalchemy/sql/compiler.py",
line 298, in visit_typeclause
        return typeclause.type.dialect_impl(self.dialect).get_col_spec()
      File
"/usr/lib/python2.5/site-packages/SQLAlchemy-0.5.2-py2.5.egg/sqlalchemy/types.py",
line 140, in get_col_spec
        raise NotImplementedError()
    NotImplementedError


Obviously I want a more completed expression but narrowed the problem down
to the "cast" function.  Any suggestions on how to accomplish this?

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