[sqlalchemy] Re: SQLAlchemy Sphinx Documentation Preview

2008-12-04 Thread Gaetan de Menten
Here are the suggestions that come to mind: - You should either get rid of, or (preferably) expand/replace the current top-level table of contents. As it is currently, there is only one useful link in there (API reference) and the table of contents block waste way too much space for just one

[sqlalchemy] Re: relation join problem

2008-12-04 Thread Dom
Thanks, that works. But now, with the attribute_mapped_collection, every language is queried and assigned to the dict (quite an overhead in my use-case). how could i achieve to load only a selected language which is dynamically assigned on the query? i thought of something like a

[sqlalchemy] Re: Abstract base class

2008-12-04 Thread Guillaume
On Dec 3, 7:39 pm, Michael Bayer [EMAIL PROTECTED] wrote: On Dec 3, 2008, at 1:26 PM, Guillaume wrote: Hello, is there a way with the ORM layer to have abstract base class like in django ? http://docs.djangoproject.com/en/dev/topics/db/models/#abstract-base- classes sure, just

[sqlalchemy] QueuePool Problem

2008-12-04 Thread Jürgen Hauptmann
Hello I am running an application with cherrypy, sqlalchemy and mysql. All is working fine but sometimes after inserting many data i get the following messages. I am using an scoped_session and remove the session if i don't need it. I only see 3 databases processe in the mysql database. br

[sqlalchemy] Re: SQLAlchemy Sphinx Documentation Preview

2008-12-04 Thread Michael Bayer
On Dec 4, 2008, at 4:21 AM, Gaetan de Menten wrote: Here are the suggestions that come to mind: - You should either get rid of, or (preferably) expand/replace the current top-level table of contents. As it is currently, there is only one useful link in there (API reference) and the table

[sqlalchemy] Re: Abstract base class

2008-12-04 Thread Michael Bayer
On Dec 4, 2008, at 7:44 AM, Guillaume wrote: The problem is not directly in the inheritance scenario, but rather creating an association to an abstract class. Let's say I have the following classes: CorporateCustomer and PrivateCustomer inheriting from the abstract class Customer. On the

[sqlalchemy] Re: QueuePool Problem

2008-12-04 Thread Michael Bayer
On Dec 4, 2008, at 4:29 AM, Jürgen Hauptmann wrote: Hello I am running an application with cherrypy, sqlalchemy and mysql. All is working fine but sometimes after inserting many data i get the following messages. I am using an scoped_session and remove the session if i don't need

[sqlalchemy] Re: SQLAlchemy Sphinx Documentation Preview

2008-12-04 Thread Michael Bayer
I've made all of these changes up on the site. The li issue was a pixel-based padding already so I just reduced that. On Dec 4, 2008, at 9:25 AM, Michael Bayer wrote: On Dec 4, 2008, at 4:21 AM, Gaetan de Menten wrote: Here are the suggestions that come to mind: - You should either

[sqlalchemy] Re: Abstract base class

2008-12-04 Thread Guillaume
sure this is called concrete table inheritance.   Though when you   make a relation to Order, you need to declare these separately for   CorporateCustomer and PrivateCustomer since the connection from a   relational perspective is different.   When concrete inheritance uses   an abc, it

[sqlalchemy] Re: Abstract base class

2008-12-04 Thread Michael Bayer
On Dec 4, 2008, at 11:18 AM, Guillaume wrote: sure this is called concrete table inheritance. Though when you make a relation to Order, you need to declare these separately for CorporateCustomer and PrivateCustomer since the connection from a relational perspective is different. When

[sqlalchemy] Can I write this query with SQLAlchemy?

2008-12-04 Thread Matt Wilson
Right now, I'm writing this query as a string. I want to know if it can be expressed with SQLAlchemy's expressions instead. Here's the query: select sh.employee_id, sum(st.stop_time - st.start_time) as hours from shift sh, shift_time st where sh.employee_id in (28630, 28648) and

[sqlalchemy] Re: Can I write this query with SQLAlchemy?

2008-12-04 Thread Michael Bayer
hi matt - here's that query generated using lexical tables, which are just like Table objects but require less boilerplace for SQL prototyping purposes: from sqlalchemy import * from sqlalchemy.sql import table, column import datetime shift = table('shift', column('employee_id', Integer),

[sqlalchemy] Re: Can I write this query with SQLAlchemy?

2008-12-04 Thread Matt Wilson
Thanks! This is really helpful. On Dec 4, 11:43 am, Michael Bayer [EMAIL PROTECTED] wrote: hi matt - here's that query generated using lexical tables, which are just like   Table objects but require less boilerplace for SQL prototyping purposes: from sqlalchemy import * from

[sqlalchemy] returning primary key of object without know what it is called.

2008-12-04 Thread Faheem Mitha
Hi, I'm trying to figure out how to have an object return its primary key without knowing what it is called. The docs in http://www.sqlalchemy.org/docs/05/sqlalchemy_orm_mapper.html look relevant, for example the function identity_key_from_instance (see entry from docs below), but I'm not