[sqlalchemy] Custom compiler for column is ignored when using aliases

2010-05-10 Thread Tobias
Hi, I am currently working on adding support for Oracle to GeoAlchemy and Oracle has some methods [1] that (somehow) are only recognized when a table alias is used. The function aliased [2] seemed to work perfectly, but then I realized that the compiler extension for my custom column is not

[sqlalchemy] Re: Sql alchemy-Oracle Error

2010-05-10 Thread dhanil anupurath
Hi This is my class definition class TaskCalendar(DeclarativeBase): __tablename__ = 'task_calendars1' cal_id = Column(Integer,Sequence('id_seq'), primary_key=True) task_id = Column(Integer, ForeignKey('tasks.task_id')) dow = Column(Integer) month = Column(Integer) day =

[sqlalchemy] (NotSupportedError) Variable_TypeByValue(): unhandled data type cx_Oracle.OBJECT

2010-05-10 Thread Tobias
Hi! Using cx_oracle and SQLAlchemy 0.6 I am having troubles with Oracle objects (cx_Oracle.OBJECT) as function parameters. For example I have a function that returns an object of type cx_Oracle.OBJECT, and now I want to use that object as argument for a new function call: obj =

[sqlalchemy] mixing metaclass with redefining the primary key of an autoloaded table

2010-05-10 Thread GHZ
Hi, Using plain Declarative, I am able to redefine a primary key column that has been autoloaded, so that I can link it to an oracle sequence and give it a new name: Id = Column('id', Integer, Sequence('table_sq'), primary_key=True) However, if I then try to add some methods to the class using

Re: [sqlalchemy] Custom compiler for column is ignored when using aliases

2010-05-10 Thread Michael Bayer
creating an alias() or otherwise using the .c. collection of any selectable that's derived from another selectable (as when you say select([sometable]).c.somecolumn) means that the Column objects are actually copies of the original column objects. This copying procedure is performed by

Re: [sqlalchemy] (NotSupportedError) Variable_TypeByValue(): unhandled data type cx_Oracle.OBJECT

2010-05-10 Thread Michael Bayer
the first step here would be to create a cx_oracle -only application that issues your query and gets the right result back.then we can make sure sqlalchemy is passing that along in the same way. The error you are seeing is generated by cx_oracle (SQLA just wraps the NotSupportedError).

Re: [sqlalchemy] mixing metaclass with redefining the primary key of an autoloaded table

2010-05-10 Thread Michael Bayer
the clue here is that you're needing to call useexisting. this means a Table that is already reflected will be pulled from the metadata. By adding your own id column, that blows away the id that was already reflected, which is what the addresses primary key is pointing to: pdb at line

Re: [sqlalchemy] scoped_session(create_session) 0.6

2010-05-10 Thread David Gardner
Yeah, the docs are confusing on this one: http://www.sqlalchemy.org/docs/reference/orm/sessions.html?highlight=sessionmaker#sqlalchemy.orm.scoped_session Parameters: * session_factory – a callable function that produces Session instances, such as sessionmaker() or create_session(). Also I took

[sqlalchemy] allow_partial_pks=False goes to database on partial pk

2010-05-10 Thread Kent
See this script, running 0.6.0: == from sqlalchemy import * from sqlalchemy.orm import * engine = create_engine('oracle://user:passw...@localhost:1521/xe? use_ansi=False',echo=True) metadata = MetaData() Session = sessionmaker(bind=engine) session

Re: [sqlalchemy] Re: Sql alchemy-Oracle Error

2010-05-10 Thread Michael Bayer
This is not enough detail to provide any insight into your issue. We would require the mapping for TaskCalendar, Tasks, as well as code which inserts the offending data into the database and then issues your query, reproducing the error you are getting. On May 10, 2010, at 8:54 AM, dhanil