Re: [sqlalchemy] maximum number of expressions in a list is 1000

2013-01-03 Thread Michael Bayer
On Jan 3, 2013, at 2:40 AM, jo wrote: Hi all, I need to use in_(), but in oracle it has a limit of 1000 values, there's an alternative syntax that can be used successful in oracle and it is: (field,-1) in ( (123,-1), (333,-1), ... ) I tryed this:

Re: [sqlalchemy] Got a problem when sqlalchemy 0.8.0b1 works with alembic 0.3.6

2013-01-03 Thread Michael Bayer
PG doesn't allow a length for the TEXT type. you might want to go with this approach: mytype = Text().with_variant(MEDIUMTEXT(), 'mysql') http://docs.sqlalchemy.org/en/rel_0_8/core/types.html?highlight=with_variant#sqlalchemy.types.TypeEngine.with_variant On Jan 3, 2013, at 9:58 AM,

[sqlalchemy] automatic company_id insertion

2013-01-03 Thread sjoerd
Hi, I have one set of tables and I want to automate the insertion of the company_id in queries at certain tables. So I need to define in the models which tables are effected, no worries there, but where do I need to implement the query manipulation? The SQLAlchemy object is shared between

Re: [sqlalchemy] automatic company_id insertion

2013-01-03 Thread Michael Bayer
On Jan 3, 2013, at 12:51 PM, sjo...@congressus.nl wrote: Hi, I have one set of tables and I want to automate the insertion of the company_id in queries at certain tables. So I need to define in the models which tables are effected, no worries there, but where do I need to implement

Re: [sqlalchemy] Got a problem when sqlalchemy 0.8.0b1 works with alembic 0.3.6

2013-01-03 Thread junepeach
Thank you! I will try :) -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To view this discussion on the web visit https://groups.google.com/d/msg/sqlalchemy/-/DHXCcCqDu-MJ. To post to this group, send email to sqlalchemy@googlegroups.com. To

Re: [sqlalchemy] automatic company_id insertion

2013-01-03 Thread sjoerd
On Thursday, January 3, 2013 8:05:29 PM UTC+1, Michael Bayer wrote: On Jan 3, 2013, at 12:51 PM, sjo...@congressus.nl javascript: wrote: Hi, I have one set of tables and I want to automate the insertion of the company_id in queries at certain tables. So I need to define in the models

Re: [sqlalchemy] automatic company_id insertion

2013-01-03 Thread Michael Bayer
On Jan 3, 2013, at 3:17 PM, sjo...@congressus.nl wrote: In this MyQuery two things need to happen; A) check whether the queried table has the certain company_id field and B) automatically implement the additional filter to add the SomeHTTPSessionGlobal.company_id (which is based on the

[sqlalchemy] Filter expression in an association proxy?

2013-01-03 Thread Chuck Bearden
Python 2.7.2 SQLAlchemy 0.8.0b2 Ubuntu 11.10 Consider the script below. The idea is that I have a medical record, and I want to store diagnoses of two kinds: referring diagnoses and post-evaluation diagnoses. I want to store them in a single table (this constraint is given by the project I

Re: [sqlalchemy] automatic company_id insertion

2013-01-03 Thread sjoerd
On Thursday, January 3, 2013 9:31:37 PM UTC+1, Michael Bayer wrote: On Jan 3, 2013, at 3:17 PM, sjo...@congressus.nl javascript: wrote: In this MyQuery two things need to happen; A) check whether the queried table has the certain company_id field and B) automatically implement the

Re: [sqlalchemy] Filter expression in an association proxy?

2013-01-03 Thread Michael Bayer
On Jan 3, 2013, at 4:01 PM, Chuck Bearden wrote: Python 2.7.2 SQLAlchemy 0.8.0b2 Ubuntu 11.10 Consider the script below. The idea is that I have a medical record, and I want to store diagnoses of two kinds: referring diagnoses and post-evaluation diagnoses. I want to store them in a

Re: [sqlalchemy] Filter expression in an association proxy?

2013-01-03 Thread Chuck Bearden
On Thursday, January 3, 2013 3:13:58 PM UTC-6, Michael Bayer wrote: On Jan 3, 2013, at 4:01 PM, Chuck Bearden wrote: Python 2.7.2 SQLAlchemy 0.8.0b2 Ubuntu 11.10 Consider the script below. The idea is that I have a medical record, and I want to store diagnoses of two kinds: referring

[sqlalchemy] max() min() string lengths?

2013-01-03 Thread James Hartley
Embarrassingly, I'm gotten lost in calling SQL functions in SQLAlchemy 0.7.1. I can boil the problem down to the following table structure: CREATE TABLE words ( id INTEGER NOT NULL, timestamp DATETIME NOT NULL, word TEXT NOT NULL, PRIMARY KEY (id), UNIQUE

[sqlalchemy] How to handle 'sub-commits'?

2013-01-03 Thread Ken Lareau
I recently (today) ran into an issue that has me perplexed as to how to resolve it, so I'm asking here to see if anyone can shed some insight. Hopefully I can ex- plain it clearly enough to make me not sound completely incompetent... I currently have an application that during it's run starts a

Re: [sqlalchemy] maximum number of expressions in a list is 1000

2013-01-03 Thread jo
_tuple() is fine, Thanks Michael :-) j Michael Bayer wrote: On Jan 3, 2013, at 2:40 AM, jo wrote: Hi all, I need to use in_(), but in oracle it has a limit of 1000 values, there's an alternative syntax that can be used successful in oracle and it is: (field,-1) in ( (123,-1), (333,-1),

[sqlalchemy] Query about exception being raised on violating uniqueness constraint

2013-01-03 Thread Gurjar, Unmesh
Hi, I have installed SQLAlchemy 0.7.9 (backend - MySQL, Python 2.7). I have a defined a table having a uniqueness constraint. On inserting a record which violates this constraint, my application gets a 'TypeError' exception instead of 'IntegrityError'. After debugging the issue, I found that