Re: [sqlalchemy] Updating user interface after rollback (using after_rollback SessionExtension?)

2011-08-02 Thread Torsten Landschoff
Hi Michael, On Mon, 2011-08-01 at 14:18 -0400, Michael Bayer wrote: The Session's default behavior is to expire fully the state present after a rollback occurs. The next access of any attribute will guaranteed pull fresh from the DB in a new transaction. I'm assuming you know this,

Re: [sqlalchemy] Relationship spanning on multiple tables

2011-08-02 Thread neurino
Sorry Michael, there was a typo in my code, due to some wrong copy/paste or search/replace I guess, I'm afraid. The error I reported comes up mapping to `TransmLimit` and not `SurfaceRes` (which is the one already mapped above). I edited the pastebin: http://pastebin.com/mjfgPrcB now with:

[sqlalchemy] Working with a ResultProxy object

2011-08-02 Thread RVince
In my controller class, I perform a rather basic, straightforward SQL query: connection = engine.connect() trans = connection.begin() try: c.result = connection.execute(select current_disposition_code,count(*) as num from cms_input_file group by

Re: [sqlalchemy] Working with a ResultProxy object

2011-08-02 Thread Tamás Bajusz
On Tue, Aug 2, 2011 at 3:07 PM, RVince rvinc...@gmail.com wrote: In my controller class, I perform a rather basic, straightforward SQL query:        connection = engine.connect()        trans = connection.begin()        try:            c.result = connection.execute(select

[sqlalchemy] Re: Working with a ResultProxy object

2011-08-02 Thread RVince
Tamas, I'm more confused now -- would I do this in my controller or in the mako file? If, in my controller, dont I need to create an array for each field, that is: i = 0 for row in c.result c.current_disposition_code[i] = row['current_disposition_code'] c.num[i] = row['num'] i = i +

Re: [sqlalchemy] Updating user interface after rollback (using after_rollback SessionExtension?)

2011-08-02 Thread Michael Bayer
On Aug 2, 2011, at 3:33 AM, Torsten Landschoff wrote: I looked at the is_active flag in SQLAlchemy 0.6.8 already and I think I can only use it with autocommit disabled. Unfortunately I use autocommit=True. if you're in autocommit=True and you're calling session.flush() which fails, it

Re: [sqlalchemy] Working with a ResultProxy object

2011-08-02 Thread Michael Bayer
On Aug 2, 2011, at 9:07 AM, RVince wrote: In my controller class, I perform a rather basic, straightforward SQL query: connection = engine.connect() connection, OK trans = connection.begin() start a transaction, OK try: c.result =

[sqlalchemy] Re: Working with a ResultProxy object

2011-08-02 Thread RVince
Michael, Right, thats a better idea -- I am working with snippets of other people's code here. However, I still have the original problem of going from a ResultProxy object to output in a mako file which is a chasm I cannnot seem to bridge! RVInce On Aug 2, 10:06 am, Michael Bayer

Re: [sqlalchemy] Re: Working with a ResultProxy object

2011-08-02 Thread Michael Bayer
On Aug 2, 2011, at 11:31 AM, RVince wrote: Michael, Right, thats a better idea -- I am working with snippets of other people's code here. However, I still have the original problem of going from a ResultProxy object to output in a mako file which is a chasm I cannnot seem to bridge!

[sqlalchemy] Re: Working with a ResultProxy object

2011-08-02 Thread RVince
Michael, But if I do the following, and do NOT close it (at least, I dont believe I am now): result = engine.execute(select current_disposition_code,count(*) as num from cms_input_file group by current_disposition_code;) c.curent_disposition_codes = [] c.num = []

Re: [sqlalchemy] SQLAlchemy 0.7.2 Released

2011-08-02 Thread Martijn Moeling
Thank you for all the effort you put in. SQLAlchemy has been a proven tool for me and as it seems for many others. On Aug 1, 2011, at 02:17 , Michael Bayer wrote: SQLAlchemy version 0.7.2 is now available. A lot has been going on leading up to this release, and there was actually a

Re: [sqlalchemy] Re: Working with a ResultProxy object

2011-08-02 Thread Michael Bayer
On Aug 2, 2011, at 12:09 PM, RVince wrote: Michael, But if I do the following, and do NOT close it (at least, I dont believe I am now): result = engine.execute(select current_disposition_code,count(*) as num from cms_input_file group by current_disposition_code;)

Re: [sqlalchemy] SQLAlchemy 0.7.2 Released

2011-08-02 Thread James Studdart
I'd just like to echo Martin's statement, thank you very much. Just your responses to this list seem like a full time job, let alone the development to SQLAlchemy - which continues to surprise and impress me with it's features and support. James. On 08/02/2011 09:28 AM, Martijn Moeling

[sqlalchemy] Re: Working with a ResultProxy object

2011-08-02 Thread RVince
LOL,I'm going backwards here, and taking far too long to get something so very simple done (there's a genuine lack of documentation here I think -- the only way to manage to learn much of this is by trial and error). Rather than trying to do this with straight SQL statements I will go plan B here

Re: [sqlalchemy] Integrity error when using association_proxy - one of the foreign keys is missing

2011-08-02 Thread Benjamin Sims
Thanks so much for the help. For the record, setting an __init__ argument on the association argument did the trick. Ben On 2 Aug 2011, at 01:47, Michael Bayer mike...@zzzcomputing.com wrote: On Aug 1, 2011, at 8:34 PM, somewhatofftheway wrote: Hi, I'm trying to convert a

Re: [sqlalchemy] Re: Building hierarchy tree in reverse

2011-08-02 Thread Vlad K.
Yes I'm using PostgreSQL and now that you've linked to the docs, I remember there was a possibility for recursion. Thanks for suggestion, I'll look into it. .oO V Oo. On 08/02/2011 03:41 AM, Gunnlaugur Briem wrote: You could look for recursive CTE (Common Table Expressions), if your

[sqlalchemy] SA Unicode and SQLite

2011-08-02 Thread Mark Erbaugh
I'm trying to follow the instructions in the SA docs regarding Unicode and SQLite. I've declared all my character fields as either Unicode or UnicodeText. When populating the data, I specify strings as unicode strings (u'string'), but I'm still getting an warning: SAWarning Unicode type

Re: [sqlalchemy] SA Unicode and SQLite

2011-08-02 Thread Michael Bayer
On Aug 2, 2011, at 6:35 PM, Mark Erbaugh wrote: I'm trying to follow the instructions in the SA docs regarding Unicode and SQLite. I've declared all my character fields as either Unicode or UnicodeText. When populating the data, I specify strings as unicode strings (u'string'), but I'm

[sqlalchemy] misleading docs on logging

2011-08-02 Thread Chris Withers
Hi All, Just me or does this: http://www.sqlalchemy.org/docs/core/engines.html?highlight=logging#configuring-logging ...imply that to get pool logging you just need to do: import logging logging.getLogger('sqlalchemy.pool').setLevel(logging.DEBUG) Whereas, in fact, you need to do: import

Re: [sqlalchemy] SA Unicode and SQLite

2011-08-02 Thread Mark Erbaugh
On Aug 2, 2011, at 6:50 PM, Michael Bayer wrote: On Aug 2, 2011, at 6:35 PM, Mark Erbaugh wrote: I'm trying to follow the instructions in the SA docs regarding Unicode and SQLite. I've declared all my character fields as either Unicode or UnicodeText. When populating the data, I

Re: [sqlalchemy] misleading docs on logging

2011-08-02 Thread Michael Bayer
On Aug 2, 2011, at 7:13 PM, Chris Withers wrote: Hi All, Just me or does this: http://www.sqlalchemy.org/docs/core/engines.html?highlight=logging#configuring-logging ...imply that to get pool logging you just need to do: import logging