[sqlalchemy] ValueError: second must be in 0..59 error?

2007-04-23 Thread Andreas Jung
During a select() I get the following error: 2007-04-23 08:02:24,447 INFO sqlalchemy.engine.base.Engine.0x..94 {'table': 24892275} class 'z3c.sqlalchemy.mapper._mapped_arbeitsmittel' 2007-04-23 08:02:24,480 INFO sqlalchemy.engine.base.Engine.0x..94 SELECT arbeitsmittel.idsachgebiet AS

[sqlalchemy] Re: ValueError: second must be in 0..59 error?

2007-04-23 Thread Andreas Jung
Additional info: using SA 0.3.6, Postgres 7.4.6, psycopg 2.0.4 Andreas --On 23. April 2007 08:09:30 +0200 Andreas Jung [EMAIL PROTECTED] wrote: During a select() I get the following error: 2007-04-23 08:02:24,447 INFO sqlalchemy.engine.base.Engine.0x..94 {'table': 24892275} class

[sqlalchemy] Re: ValueError: second must be in 0..59 error?

2007-04-23 Thread Andreas Jung
--On 23. April 2007 08:18:54 +0200 Andreas Jung [EMAIL PROTECTED] wrote: Additional info: using SA 0.3.6, Postgres 7.4.6, psycopg 2.0.4 Andreas File build/bdist.linux-i686/egg/sqlalchemy/engine/base.py, line 971, in fetchall ValueError: second must be in 0..59 Any idea where this is

[sqlalchemy] Re: ValueError: second must be in 0..59 error?

2007-04-23 Thread Andreas Kostyrka
* Andreas Jung [EMAIL PROTECTED] [070423 09:49]: --On 23. April 2007 08:18:54 +0200 Andreas Jung [EMAIL PROTECTED] wrote: Additional info: using SA 0.3.6, Postgres 7.4.6, psycopg 2.0.4 Andreas File build/bdist.linux-i686/egg/sqlalchemy/engine/base.py, line 971, in fetchall

[sqlalchemy] Re: apache, engine and metadata

2007-04-23 Thread ml
2) the number of connections to the db growing ... is implemented well the MetaData() class ? I'm using postgresql schema's and I want to mantain a single connection for every db user. Hi! I had the same problem because I was calling create_engine in every page request (apache +

[sqlalchemy] Catching username password errors

2007-04-23 Thread Koen Bok
I am trying to catch username password errors to show in the interface. But somehow I cannot catch the exeption. I wrap everything in a try except, but the exeption is still throwed and my app stops functioning. What am I doing wrong? Koen loginInfo = (

[sqlalchemy] Re: Catching username password errors

2007-04-23 Thread svilen
and the exception traceback is? also, do provide something functional as tryout-case. On Monday 23 April 2007 16:54:40 Koen Bok wrote: I am trying to catch username password errors to show in the interface. But somehow I cannot catch the exeption. I wrap everything in a try except, but the

[sqlalchemy] Re: Solution!!! ENUM type that works with sqlite too

2007-04-23 Thread Brett
http://www.sqlalchemy.org/trac/wiki/UsageRecipes/Enum On Sun, 2007-04-22 at 13:33 +, Ian Charnas wrote: I'm sure a lot of us have done something like this, I figured I'd post it so people can find it in a google search and won't have to write it and debug it themselves... This is a Type

[sqlalchemy] Re: Proposal: Make pyodbc the preferred DB-API for MSSQL

2007-04-23 Thread Paul Johnston
Hi, Something like: from sqlalchemy import * import pyodbc db = create_engine('mssql://./test', module=pyodbc) While we're on the subject, it would be good to be able to specify the module as a string, e.g. module_name='pyodbc' as then you could specify the module from a configuration

[sqlalchemy] Re: Proposal: Make pyodbc the preferred DB-API for MSSQL

2007-04-23 Thread Michael Bayer
On Apr 23, 2007, at 1:30 PM, Paul Johnston wrote: Hi, Something like: from sqlalchemy import * import pyodbc db = create_engine('mssql://./test', module=pyodbc) While we're on the subject, it would be good to be able to specify the module as a string, e.g. module_name='pyodbc' as

[sqlalchemy] Re: Could not assemble any primary key columns for mapped table error for views

2007-04-23 Thread Michael Bayer
On Apr 23, 2007, at 1:23 PM, Andreas Jung wrote: I have a view arbeitsmittelhierarchy_arbeitsmittle_view which is defined as a left join of two tables. Trying to generate a mapper from the autoload view as Table() fails: File build/bdist.linux-i686/egg/sqlalchemy/orm/session.py, line

[sqlalchemy] Selectable/subquery for a (scalar) column?

2007-04-23 Thread Gaetan de Menten
Hello there, In a mapped object, is there any way to map a scalar attribute to an arbitrary selectable/subquery? Jonathan Ellis demonstrated how to do that for relations on this page: http://spyced.blogspot.com/2007/01/why-sqlalchemy-impresses-me.html I'd like to do that for scalars. I've

[sqlalchemy] Re: Selectable/subquery for a (scalar) column?

2007-04-23 Thread Michael Bayer
On Apr 23, 2007, at 3:49 PM, Gaetan de Menten wrote: Hello there, In a mapped object, is there any way to map a scalar attribute to an arbitrary selectable/subquery? Jonathan Ellis demonstrated how to do that for relations on this page:

[sqlalchemy] Re: subquery using the ORM

2007-04-23 Thread Karthik Krishnamurthy
I don't have a very good idea about that. But I do know the query I have used works. Still hoping somebody has an idea of how to achieve that using the ORM. Or maybe I should be using a select and then mapping it. /kk On 4/20/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: sorry for my

[sqlalchemy] Re: subquery using the ORM

2007-04-23 Thread Michael Bayer
assuming a reasonable mapping (i.e. the m2m example in the datamapping docs) session.query(Node).select(and_( nodes.c.id.in_(select([group_nodes.c.node_id], group_nodes.c.group_id==1, correlate=False), nodes.c.id.in_(select([group_nodes.c.node_id], group_nodes.c.group_id==2,

[sqlalchemy] different number range for primary key

2007-04-23 Thread hongyuan1306
Hi everyone, I have a product table which has a product_id field as the primary key. I'd like to have the value of this field be generated from two sequences with different number range depending on the content of the product_type field. E.g., when product_type == 1, product_id will be generated