[sqlalchemy] Re: Q: fetch value of autoincrement column

2009-05-22 Thread Alexandre Conrad
Don't you want that non-null column to be a foreign key ? 2009/5/21 Adrian von Bidder avbid...@fortytwo.ch: Hi, Is it possible to fetch the values of an autoincrement field without flushing the object to the DB? (In postgres, I obviously can manually fetch nextval of the automatically

[sqlalchemy] Re: Small note on reading SA docs

2009-05-22 Thread semafor
Oh, I was not aware. The 05 docs is, as you say, addressing some of my points. Thanks On May 22, 1:14 am, semafor jo...@drange.net wrote: Hi. Currently, the documentation for SA is not easy for the eyes. Usinghttp://www.sqlalchemy.org/docs/04/sqlalchemy_engine.htmlas an example, there are

[sqlalchemy] TimeoutError: QueuePool limit of size 5 overflow 10 reached, connection timed out, timeout 30

2009-05-22 Thread Marcin Krol
Hello everyone, After some time of operation (a day or so), from time to time I'm getting this error: TimeoutError: QueuePool limit of size 5 overflow 10 reached, connection timed out, timeout 30 I have to stress that not much activity is taking place on that OS as it is development

[sqlalchemy] Filtering a polymorphic with 'any'

2009-05-22 Thread Stefano Bartaletti
Hi, I am trying the following: import sqlalchemy as sqa from sqlalchemy import orm engine = sqa.create_engine(sqlite://, echo=True) meta = sqa.MetaData(bind=engine) Session = orm.scoped_session(orm.sessionmaker(bind=engine, autocommit=True,autoflush=False)) tab = sqa.Table(test, meta,

[sqlalchemy] Filtering a polymorphic with 'any'

2009-05-22 Thread Stefano Bartaletti
Hi, I am trying the following: import sqlalchemy as sqa from sqlalchemy import orm engine = sqa.create_engine(sqlite://, echo=True) meta = sqa.MetaData(bind=engine) Session = orm.scoped_session(orm.sessionmaker(bind=engine, autocommit=True,autoflush=False)) tab = sqa.Table(test, meta,

[sqlalchemy] Re: Small note on reading SA docs

2009-05-22 Thread Adrian von Bidder
On Friday 22 May 2009 01.59:13 Michael Bayer wrote: otherwise if you have any advice on how to get 0.4/0.3 delisted from such a prominent place on Google, that would be appreciated. Since removing them entirely is an option for you, perhaps just completely remove them from search engines

[sqlalchemy] Re: Q: fetch value of autoincrement column

2009-05-22 Thread Adrian von Bidder
On Friday 22 May 2009 08.43:09 Alexandre Conrad wrote: Don't you want that non-null column to be a foreign key ? Would that make a difference? cheers -- vbi 2009/5/21 Adrian von Bidder avbid...@fortytwo.ch: Hi, Is it possible to fetch the values of an autoincrement field without

[sqlalchemy] Re: Q: fetch value of autoincrement column

2009-05-22 Thread Werner F. Bruhin
Adrian, Adrian von Bidder wrote: Hi, Is it possible to fetch the values of an autoincrement field without flushing the object to the DB? (In postgres, I obviously can manually fetch nextval of the automatically generated sequence, but I lose the portability that way ...) Why?

[sqlalchemy] Re: Q: fetch value of autoincrement column

2009-05-22 Thread Alexandre Conrad
Hello Adrian, 2009/5/22 Adrian von Bidder avbid...@fortytwo.ch: On Friday 22 May 2009 08.43:09 Alexandre Conrad wrote: Don't you want that non-null column to be a foreign key ? Would that make a difference? That's what a foreign key is used for: http://en.wikipedia.org/wiki/Foreign_key I

[sqlalchemy] Can't determine join between 'engines' and 'versions'. Please specify the 'onclause' of this join explicitly ?

2009-05-22 Thread sniipe
Hi :) I have three tables: 1) t_version = sa.Table(versions, meta.metadata, sa.Column(id, sa.types.Integer(), primary_key=True, autoincrement=True), sa.Column(version, mysql.MSChar(length=100, collation='utf8_polish_ci'), nullable=False, unique=True) ) class Version(object): pass

[sqlalchemy] Creating something with a unique, random key

2009-05-22 Thread Iwan
Hi there, I am working with SqlAlchemy for the first time (coming from SqlObject), and I fear I may not understand it as well as I thought I did... I have a class (X), persisted with SA which contains a key (X.key) which is a randomly generated string of fixed length. This field is supposed to

[sqlalchemy] Re: Small note on reading SA docs

2009-05-22 Thread Benjamin A. Shelton
I've had quite the opposite experience with SQLAlchemy's documentation, and I just started using it for a couple of small projects about two weeks ago. Once I was accustomed to the site layout, it became reasonably easy to find what I was looking for. Specifically, I've been using the integrated

[sqlalchemy] Re: Small note on reading SA docs

2009-05-22 Thread Michael Bayer
Bobby Impollonia wrote:  otherwise if you have any advice on how to get 0.4/0.3 delisted from such a prominent place on Google, that would be appreciated. The simplest thing to do is to append: Disallow: /docs/04/ Disallow: /docs/03/ agreed, this is done.

[sqlalchemy] Re: Small note on reading SA docs

2009-05-22 Thread Michael Bayer
Bobby Impollonia wrote: I also noticed that your current robots.txt file disallows indexing of anything under /trac/. It would nice to let google index bugs in trac so that someone who searches google for sqlalchemy help can come across an extant bug describing their problem. In addition,

[sqlalchemy] Re: Can't determine join between 'engines' and 'versions'. Please specify the 'onclause' of this join explicitly ?

2009-05-22 Thread Michael Bayer
sniipe wrote: Hi :) I have three tables: 1) t_version = sa.Table(versions, meta.metadata, sa.Column(id, sa.types.Integer(), primary_key=True, autoincrement=True), sa.Column(version, mysql.MSChar(length=100, collation='utf8_polish_ci'), nullable=False, unique=True) ) class

[sqlalchemy] Re: Creating something with a unique, random key

2009-05-22 Thread Michael Bayer
Iwan wrote: Hi there, I am working with SqlAlchemy for the first time (coming from SqlObject), and I fear I may not understand it as well as I thought I did... I have a class (X), persisted with SA which contains a key (X.key) which is a randomly generated string of fixed length. This

[sqlalchemy] Re: Creating something with a unique, random key

2009-05-22 Thread Adrian von Bidder
On Friday 22 May 2009 12.01:05 Iwan wrote: Naïvely, I thought you'd create an X, flush it, and then catch any IntegrityError's thrown. [...] I know that PostgreSQL can't continue in a transaction after an error, you have to roll back the transaction. I don't know what the SQL standard says

[sqlalchemy] Re: Q: fetch value of autoincrement column

2009-05-22 Thread Adrian von Bidder
On Friday 22 May 2009 13.58:34 Alexandre Conrad wrote: Hello Adrian, 2009/5/22 Adrian von Bidder avbid...@fortytwo.ch: On Friday 22 May 2009 08.43:09 Alexandre Conrad wrote: Don't you want that non-null column to be a foreign key ? Would that make a difference? That's what a foreign

[sqlalchemy] Re: Create a stored procedure using SQLAlchemy

2009-05-22 Thread Daniel
Thanks. This works great. On May 20, 4:54 pm, Clovis Fabricio nos...@gmail.com wrote: 2009/5/19 Daniel daniel.watr...@gmail.com: Hello, I have a stored procedure for SQL Server and I would like to be able to execute the code to create the stored procedure using SA.  Here's the basic

[sqlalchemy] Re: Can't determine join between 'engines' and 'versions'. Please specify the 'onclause' of this join explicitly ?

2009-05-22 Thread sniipe
Ok It's working but I can't use 'between': engine = meta.Session.query(Engine).outerjoin((Version, Engine.min_version_id==Version.id)).filter(between(request.POST ['version'], Engine.min_version.version, Engine.max_version.version)).all() and I've got error: AttributeError: Neither

[sqlalchemy] Re: Q: fetch value of autoincrement column

2009-05-22 Thread Alexandre Conrad
Could you please send your SQLAlchemy tables you are working with to have a better idea of what's you want to achieve ? 2009/5/22 Adrian von Bidder avbid...@fortytwo.ch: On Friday 22 May 2009 13.58:34 Alexandre Conrad wrote: Hello Adrian, 2009/5/22 Adrian von Bidder avbid...@fortytwo.ch:

[sqlalchemy] Re: Can't determine join between 'engines' and 'versions'. Please specify the 'onclause' of this join explicitly ?

2009-05-22 Thread Michael Bayer
Engine.min_version and max_version are instrumented column attributes. they don't have an attribute called version. i think you want between(x, Engine.min_version, Engine.max_version). sniipe wrote: Ok It's working but I can't use 'between': engine =

[sqlalchemy] Re: Can't determine join between 'engines' and 'versions'. Please specify the 'onclause' of this join explicitly ?

2009-05-22 Thread Michael Bayer
that means min_version and max_version aren't columns.I guess you're looking for Version.version, in which case you probably need to JOIN to that table twice on both the min_version and max_version. write (and test) the query you want in SQL first to get an idea for what you're doing.