[sqlalchemy] session.merge behaviour in case of String type primary keys

2014-03-20 Thread RedBaron
Hi, It looks like session.merge() converts String type primary key to its lower-case equivalent before processing. from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker, scoped_session from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column,Str

Re: [sqlalchemy] Migrating from 0.8.2 to 0.9.3 causes ArgumentError

2014-02-24 Thread RedBaron
On Monday, 24 February 2014 23:23:05 UTC+5:30, Michael Bayer wrote: > > > OK, hm you just have the *, OK.That’s a regression, it’s fixed in > d966920b3df253292a28f2a. > > The fix works. Thanks again. -- You received this message because you are subscribed to the Google Groups "sqlalchem

[sqlalchemy] Re: Migrating from 0.8.2 to 0.9.3 causes ArgumentError

2014-02-23 Thread RedBaron
OK I managed to find the offending part. It seems `options(lazylaod('*'))` which was my default "sledge-hammer" to ensure that only needed tables are joined (to form compact queries) is at fault. Removing `options()` also removes the errors. I understand that in 0.9.x a new `Load` interface was

[sqlalchemy] Migrating from 0.8.2 to 0.9.3 causes ArgumentError

2014-02-23 Thread RedBaron
Hi, After a lot of inertia I finally decided to migrate to 0.9.3 from 0.8.2 (A long jump I know). I re-ran my tests and found a lot of ArgumentErrors. The offending query and the error was sensors = session.query(SensorExtra) .with_entities(SensorExtra.sid.label('sid')) .options(lazyload('*')).f

[sqlalchemy] Re: Understanding Association Proxies

2013-10-09 Thread RedBaron
I think I did not follow the tutorial properly. That step is done for "Association Objects" which I do not have in my simple example. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from i

[sqlalchemy] Understanding Association Proxies

2013-10-09 Thread RedBaron
Hi, I was trying to work through the many-to-many relationship tutorial and understand the concept of Association Proxies. (Using SA-0.8.2) Here's my model book_author_table = Table('book_author',Base.metadata, Column('book_id',Integer,ForeignKey('book.id')),

Re: [sqlalchemy] Updating using a join - Wrong parameter substitution order

2013-06-30 Thread RedBaron
The fix mentioned in the ticket works for me. Thanks, Dheeraj On Friday, 28 June 2013 20:45:50 UTC+5:30, Michael Bayer wrote: > > > On Jun 28, 2013, at 10:26 AM, RedBaron > > wrote: > > Thanks for the reply. I understand that update against multiple tables is > non-stan

Re: [sqlalchemy] Updating using a join - Wrong parameter substitution order

2013-06-28 Thread RedBaron
parameters and they can occur in almost any combination. Probably another way (long and not good) is to fire a query and do a for a in result: a.isdel = True On Friday, 28 June 2013 19:44:29 UTC+5:30, Michael Bayer wrote: > > > On Jun 28, 2013, at 8:23 AM, RedBaron > > w

[sqlalchemy] Updating using a join - Wrong parameter substitution order

2013-06-28 Thread RedBaron
Hi, I am using SQLAlchemy - 0.8.1 Background - I have a table "event" which has a flag 'is_deleted'. This table has a composite primary key (sid,cid). There are many other tables related to "event" that store information regarding that event - e.g. "iphdr". I want to give the user an option of

[sqlalchemy] Handle Server Disruption

2012-10-08 Thread RedBaron
Hi, I am writing a standalone program that uses SQLAlchemy for DB related ops. The program is a log parser that runs continuously, processes the log file and writes those entries to the database. Connection to DB is done like so engine = create_engine('mysql+mysqldb://root:root123@localhost/ mydb'

Re: [sqlalchemy] Joining across multiple databases using temporary tables in a web-app

2012-09-10 Thread RedBaron
Thanks for helping me with that one. I guess I'll stick to what I am doing at the moment (minus the Bind.metadata ofcourse!!) while adding a core SQL insert() On Monday, 10 September 2012 20:04:17 UTC+5:30, Michael Bayer wrote: > > > On Sep 10, 2012, at 1:15 AM, RedBaron wrote: &g

[sqlalchemy] Joining across multiple databases using temporary tables in a web-app

2012-09-09 Thread RedBaron
I am writing a web-app using Pyramid and in a couple of views I need to do a join across databases. I have two separate models in my web-app and initialize SQlalchemy for both separately like so Database - users: DBSession_users = scoped_session(sessionmaker(extension=ZopeTransactionExten

[sqlalchemy] Re: Upgrade to 0.7.8 breaks code for query().all()

2012-07-08 Thread RedBaron
utside of the Signature > >> class: > > >> Signature.sig_count = column_property( > >>                   select([func.count('*')]).\ > >>                       where(SnortEvent.signature == Signature.id).\ > >>                       correlate

[sqlalchemy] Upgrade to 0.7.8 breaks code for query().all()

2012-07-08 Thread RedBaron
I have written some code on (I think) SqlAlchemy 0.7.5 on my office computer and it works perfectly. Now I tried to run the same code on my home computer and installed Sqlalchemy 0.7.8. However, the first query statement returned an error "InvalidRequestError: Select statement 'SELECT count(%s) AS

[sqlalchemy] ORM or Core

2011-09-20 Thread RedBaron
Hi, I am a newbie to SQLAlchemy. While reading the docs on the sqlalchemy site, I was a bit confused about ORM and Core. >From what I understand, we can define table and class mapping either through ORM (defining a class that extends Base and so on) or we can directly use Core components (Define Ta