Re: [sqlalchemy] unhandled data type cx_Oracle.LOB

2015-03-16 Thread Michael Bayer
GP pandit.gau...@gmail.com wrote: OK, is “cancellation_obj” a column object with CLOB as the datatype ? Yes, that's how it's defined in the database. Because of dynamic nature of the code, I was using append_column without specifying column type. I made changes to define column in

Re: [sqlalchemy] unhandled data type cx_Oracle.LOB

2015-03-16 Thread Michael Bayer
GP pandit.gau...@gmail.com wrote: That's what I thought, and it works, but there seems to be a difference in how resultset is handled when you select LOB column. Here is a basic script, that selects record from a source table which has 36 rows. It fetches 10 records at a time. from

Re: [sqlalchemy] unhandled data type cx_Oracle.LOB

2015-03-16 Thread GP
That's what I thought, and it works, but there seems to be a difference in how resultset is handled when you select LOB column. Here is a basic script, that selects record from a source table which has *36* rows. It fetches *10* records at a time. from sqlalchemy import Table, select,

[sqlalchemy] Sqlalchemy, Flask-User scoped_session

2015-03-16 Thread Wolf Reitsamer
Hi everyone, I can't get the following straight although I guess it's a pretty obvious thing, since I haven't found much about this topic online. I wrote a little python/flask/sqlalchemy based web-service where I want users to register themselves to post something. I also use flask-admin,

Re: [sqlalchemy] Sqlalchemy, Flask-User scoped_session

2015-03-16 Thread Simon King
On Mon, Mar 16, 2015 at 1:41 PM, Wolf Reitsamer wolf.reitsa...@gmail.com wrote: Hi everyone, I can't get the following straight although I guess it's a pretty obvious thing, since I haven't found much about this topic online. I wrote a little python/flask/sqlalchemy based web-service where I

[sqlalchemy] deferred groups

2015-03-16 Thread tonthon
Hi, I'm using polymorphism and I set up some deferred columns at each level of inheritance belonging to the same deferred group : class Base(DBBASE): id = Column(Integer, primary_key=True) name = Column(String(255)) description = deferred( Column(Text()), group=full

Re: [sqlalchemy] deferred groups

2015-03-16 Thread Michael Bayer
tonthon tontho...@gmail.com wrote: Hi, I'm using polymorphism and I set up some deferred columns at each level of inheritance belonging to the same deferred group : class Base(DBBASE): id = Column(Integer, primary_key=True) name = Column(String(255)) description =

Re: [sqlalchemy] deferred groups

2015-03-16 Thread tonthon
Sorry, still a few mistakes in what I wrote (first testing what you paste is a far better way to work) : 121 from sqlalchemy.orm import deferred 122 from sqlalchemy import Text 123

Re: [sqlalchemy] deferred groups

2015-03-16 Thread Michael Bayer
tonthon tontho...@gmail.com wrote: Sorry I was a bit too speed when writing that one :) So I've got a Base model : class Base(DBBASE): __tablename__ = 'base' __mapper_args__ = {'polymorphic_identity': 'base', 'polymorphic_on':

Re: [sqlalchemy] deferred groups

2015-03-16 Thread tonthon
Thanks a lot for the time you spent on my question (and for the answer). I'll try to make it directly clear next time. Regards Le 16/03/2015 17:49, Michael Bayer a écrit : tonthon tontho...@gmail.com wrote: Sorry, still a few mistakes in what I wrote (first testing what you paste is a far

Re: [sqlalchemy] deferred groups

2015-03-16 Thread Michael Bayer
tonthon tontho...@gmail.com wrote: Sorry, still a few mistakes in what I wrote (first testing what you paste is a far better way to work) : 121 from sqlalchemy.orm import deferred 122 from sqlalchemy import Text

Re: [sqlalchemy] deferred groups

2015-03-16 Thread tonthon
Sorry I was a bit too speed when writing that one :) So I've got a Base model : class Base(DBBASE): __tablename__ = 'base' __mapper_args__ = {'polymorphic_identity': 'base', 'polymorphic_on': 'type_'} id = Column(Integer,

Re: [sqlalchemy] Sqlalchemy, Flask-User scoped_session

2015-03-16 Thread Jonathan Vanasco
On Monday, March 16, 2015 at 10:22:27 AM UTC-4, Simon King wrote: It sounds like flask-user assumes that you are using Flask-SQLAlchemy's special declarative_base class. I think that as long as you use Flask-SQLAlchemy's session (which is a scoped_session) and declarative_base

Re: [sqlalchemy] unhandled data type cx_Oracle.LOB

2015-03-16 Thread GP
I think now I (probably) know where this may be coming from. You asked is the original query a plain string and not a Core SQL expression The way I am forming the query is by using select , append_column, append_whereclause and finally *append_from*('my_table'). I think this pretty much

Re: [sqlalchemy] unhandled data type cx_Oracle.LOB

2015-03-16 Thread GP
So that's what was happening: This select construct *fails*: select_query = select() select_query.append_column(contract_id) select_query.append_column(cancel_dt) select_query.append_column(cancellation_obj) select_query.append_from(source_table_name) But this select construct *works*:

Re: [sqlalchemy] Sqlalchemy, Flask-User scoped_session

2015-03-16 Thread Wolf Reitsamer
Thanks a lot, guys! Both your answers were very helpful. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this

[sqlalchemy] unhandled data type cx_Oracle.LOB

2015-03-16 Thread GP
Hello, While trying to insert into an Oracle table with one column defined as CLOB, I get the following error: File /home/x/.local/lib/python3.4/site-packages/sqlalchemy/engine/default.py , line 442, in do_execute cursor.execute(statement, parameters) sqlalchemy.exc.NotSupportedError:

Re: [sqlalchemy] unhandled data type cx_Oracle.LOB

2015-03-16 Thread Michael Bayer
GP pandit.gau...@gmail.com wrote: Hello, While trying to insert into an Oracle table with one column defined as CLOB, I get the following error: File /home/x/.local/lib/python3.4/site-packages/sqlalchemy/engine/default.py, line 442, in do_execute cursor.execute(statement,