[sqlalchemy] Re: Rollback error in the first query of the session.

2009-04-03 Thread Josh Winslow
On Apr 2, 9:21 pm, Michael Bayer zzz...@gmail.com wrote: On Apr 2, 4:41 pm, Josh Winslow jwins...@gmail.com wrote: This is the stack trace: ⇝  InvalidRequestError: The transaction is inactive due to a rollback in a subtransaction. Issue rollback() to cancel the

[sqlalchemy] Re: Insertion issues

2009-04-03 Thread Mike Conley
conn = eng.connect() conn.execute(users.insert(), [{'name':'joe', '10:00':'1200'}]) -- Mike Conley On Fri, Apr 3, 2009 at 12:07 AM, Tanmoy mukherjee.tan...@gmail.com wrote: Tried that...dosent work Tom --~--~-~--~~~---~--~~ You

[sqlalchemy] Re: Insertion issues

2009-04-03 Thread Tanmoy
import sqlalchemy from sqlalchemy import * engine = create_engine('mysql://root:voxta...@localhost/stock') metadata = MetaData() users=Table('NSE', metadata, Column('Company_ID',String(40),primary_key=True), Column('10:00',Numeric(8,2)), ) metadata.create_all(engine) conn =

[sqlalchemy] Re: Insertion issues

2009-04-03 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Tanmoy Sent: 03 April 2009 14:30 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re: Insertion issues import sqlalchemy from sqlalchemy import * engine =

[sqlalchemy] Re: Rollback error in the first query of the session.

2009-04-03 Thread Michael Bayer
Josh Winslow wrote: On Apr 2, 9:21 pm, Michael Bayer zzz...@gmail.com wrote: On Apr 2, 4:41 pm, Josh Winslow jwins...@gmail.com wrote: This is the stack trace: ⇝  InvalidRequestError: The transaction is inactive due to a rollback in a subtransaction. Issue

[sqlalchemy] Re: Rollback error in the first query of the session.

2009-04-03 Thread Josh Winslow
On Apr 3, 10:13 am, Michael Bayer mike...@zzzcomputing.com wrote: Josh Winslow wrote: On Apr 2, 9:21 pm, Michael Bayer zzz...@gmail.com wrote: On Apr 2, 4:41 pm, Josh Winslow jwins...@gmail.com wrote: This is the stack trace: ⇝  InvalidRequestError: The

[sqlalchemy] Re: Insertion issues

2009-04-03 Thread Tanmoy
Actually i did put 'Company_ID':'Joe' and i could run it.please try putting in mysql and let me know if there is a issue. Tom --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post

[sqlalchemy] Re: Odd-looking error AttributeError: 'RelationProperty' object has no attribute 'strategy' when *working* code is moved to another file

2009-04-03 Thread phrrn...@googlemail.com
So I guess that symbols starting with underscore ('_') are treated differently in Python when it comes to be exporting/importing? Sorry to be such a newb but this is the only conclusion I can (rationally!) come to. Traceback (most recent call last): File chimera_driver.py, line 42, in module

[sqlalchemy] Re: _should_log_info - Setting up logging correctly.

2009-04-03 Thread Toby Bradshaw
Well problem worked around by using echo=True for dev builds and thanks for your suggestion. Your statement: Doing setLevel() etc. you have to do before any SQLAlchemy code is imported Unfortunately doesn't seem to help since the logging module later reports: No handlers could be found for

[sqlalchemy] Possible caching problem

2009-04-03 Thread Toby Bradshaw
I wasn't aware SQLAlchemy had any kind of cache built in but I do seem to be seeing some behaviour that sure looks like it. I have an SQA/cherrypy app which shares the DB with another app using MySQLdb only. Updates in the thirdparty are visible to the thirdparty immediately. They're not

[sqlalchemy] Re: Odd-looking error AttributeError: 'RelationProperty' object has no attribute 'strategy' when *working* code is moved to another file

2009-04-03 Thread phrrn...@googlemail.com
OK. This appears to be the source of the problem. You may recall a couple of weeks ago that I was looking for information on how to surface comments from the database metadata into the sqlalchemy model and into docstrings in mapped classes? I took your suggestion and modified it slightly. When I

[sqlalchemy] Re: Generating a _BinaryExpression

2009-04-03 Thread Christiaan Putter
Hi Svil, My integration between traits and sqlalchemy is working rather well (at least it's passing the unit tests I could think of). Thanks for all your help on that. Now I'm trying to do something similar to what you did in dbcook with expressions. I'd like to construct a gui for the user

[sqlalchemy] Re: Odd-looking error AttributeError: 'RelationProperty' object has no attribute 'strategy' when *working* code is moved to another file

2009-04-03 Thread Michael Bayer
what does compile_mappers() say?can you call this mapper, and at the same time all mappers within the entire application have been called ? phrrn...@googlemail.com wrote: I copied the list of import statements from the module file (deshaw.dbo.chimera) to the driver file. The driver file

[sqlalchemy] Re: _should_log_info - Setting up logging correctly.

2009-04-03 Thread Michael Bayer
Toby Bradshaw wrote: Well problem worked around by using echo=True for dev builds and thanks for your suggestion. Your statement: Doing setLevel() etc. you have to do before any SQLAlchemy code is imported Unfortunately doesn't seem to help since the logging module later reports: No

[sqlalchemy] Re: Possible caching problem

2009-04-03 Thread Michael Bayer
Toby Bradshaw wrote: I wasn't aware SQLAlchemy had any kind of cache built in but I do seem to be seeing some behaviour that sure looks like it. I have an SQA/cherrypy app which shares the DB with another app using MySQLdb only. Updates in the thirdparty are visible to the thirdparty

[sqlalchemy] Re: Odd-looking error AttributeError: 'RelationProperty' object has no attribute 'strategy' when *working* code is moved to another file

2009-04-03 Thread phrrn...@googlemail.com
I don't see any output from it at all. I am calling it after importing everything but before making any queries. The mapper registry looks unsurprising (albeit based on a guess of what it does) pjjH from sqlalchemy.orm import compile_mappers s = MySession(bind=e) print compile_mappers() q =

[sqlalchemy] Re: Odd-looking error AttributeError: 'RelationProperty' object has no attribute 'strategy' when *working* code is moved to another file

2009-04-03 Thread phrrn...@googlemail.com
Not sure if this is relevant? As you might have guessed from my posts, I am at the 'waving a dead chicken' around stage of debugging. pjjH (Pdb) import pickle (Pdb) print pickle.dumps(m) *** PicklingError: Can't pickle class 'sqlalchemy.orm.properties.Comparator': it's not found as

[sqlalchemy] Re: Odd-looking error AttributeError: 'RelationProperty' object has no attribute 'strategy' when *working* code is moved to another file

2009-04-03 Thread Michael Bayer
phrrn...@googlemail.com wrote: # class AttachNotesAsDocstring(interfaces.InstrumentationManager): # def instrument_attribute(self, class_, key, attr): # if isinstance(attr.property, properties.ColumnProperty): # if hasattr(attr.property.columns[0], 'info'): #

[sqlalchemy] Re: Generating a _BinaryExpression

2009-04-03 Thread az
well... the thing is an AST of a very simple language - python-like expressions (and that is not SQL! e.g. a.b.c == x.y.z whateverelse). u can do with that AST whatever u want - save/load or translate into something else, that is, another grammar. u can build a gui builder/editor over the

[sqlalchemy] Re: Odd-looking error AttributeError: 'RelationProperty' object has no attribute 'strategy' when *working* code is moved to another file

2009-04-03 Thread phrrn...@googlemail.com
Yes, the erroneous behavior goes away when this code is commented out. No, an empty instrumentation manager *does not cause* the error. Note that I had a sqlalchemy Table object called 'attributes' in my model. I have changed the code so that I do not import 'attributes' from sqlalchemy.orm but

[sqlalchemy] Re: Odd-looking error AttributeError: 'RelationProperty' object has no attribute 'strategy' when *working* code is moved to another file

2009-04-03 Thread Michael Bayer
any chance of producing a *small* test case for this phrrn...@googlemail.com wrote: Yes, the erroneous behavior goes away when this code is commented out. No, an empty instrumentation manager *does not cause* the error. Note that I had a sqlalchemy Table object called 'attributes' in my

[sqlalchemy] Re: Odd-looking error AttributeError: 'RelationProperty' object has no attribute 'strategy' when *working* code is moved to another file

2009-04-03 Thread phrrn...@googlemail.com
Sure. I am going to leave it until Monday or Tuesday as I hope by that time to return to my work on getting the Sybase driver to pass the test cases. I was away on vacation until last Monday and found it difficult to get back into coding until of course I was confronted by this issue! Thanks