[sqlalchemy] newbie question: best way to factor and group data when only some columns change

2018-06-13 Thread Robert Henry
I have a tester that controls 30 independent variables. Each variable can have about 40 different values. Periodically, I run a test. I choose 2 of the 30 independent variables, and over the next few minutes, fully iterate those 2 variables relative to each other, visiting each point in a

[sqlalchemy] Newbie Question: Aliases not Aliasing?

2013-05-07 Thread Haoyi Li
I posted this questionhttp://stackoverflow.com/questions/16410888/sqlalchemy-aliases-not-aliasingto StackOverflow, but thought this may be a better place to ask. I have the following sqlalchemy code: x = bbc.alias().c w = bbc.alias().cselect([func.distinct(x.region)]).where(

Re: [sqlalchemy] Newbie Question: Aliases not Aliasing?

2013-05-07 Thread Michael Bayer
update the SO question too for me...in this case it needs a clue to interpret the select as a scalar: subq = select([func.sum(w.population)]).where((w.region == x.region)) print select([func.distinct(x.region)]).where(subq.as_scalar() 1) the WHERE 1 you're getting is because

Re: [sqlalchemy] Newbie Question: Aliases not Aliasing?

2013-05-07 Thread Haoyi Li
Thanks, that worked! A follow up question to make sure i'm understanding this right: I'm looking at the effect of .as_scalar() on the query, and it seems that any query I call .as_scalar() on simply gets wrapped in parenthesis. I tested it out and it seems that it works even in cases where I

Re: [sqlalchemy] Newbie Question: Aliases not Aliasing?

2013-05-07 Thread Michael Bayer
it's a Python thing, it turns the FromClause into a ColumnElement which then has operators like __eq__(), __lt__(), etc. On May 7, 2013, at 2:29 PM, Haoyi Li haoyi...@gmail.com wrote: Thanks, that worked! A follow up question to make sure i'm understanding this right: I'm looking at the

Re: [sqlalchemy] Newbie question

2011-07-28 Thread Kent Tenney
On Wed, Jul 27, 2011 at 2:48 PM, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 27, 2011, at 3:21 PM, Kent Tenney wrote: Howdy, I'm aggregating data from several Sqlite files into a Postgres db. The sqlite files are storage for several apps I use: Shotwell, Firefox, Zotero, Banshee

Re: [sqlalchemy] Newbie question

2011-07-28 Thread Michael Bayer
On Jul 28, 2011, at 11:47 AM, Kent Tenney wrote: It offers choices in that you can A. use core only or B. the ORM, as well as choices in that it works with whatever kind of schema you'd like, I'll be studying doc for a better idea of the A/B distinction, as well as what kinds of schemas

[sqlalchemy] Newbie question

2011-07-27 Thread Kent Tenney
Howdy, I'm aggregating data from several Sqlite files into a Postgres db. The sqlite files are storage for several apps I use: Shotwell, Firefox, Zotero, Banshee ... I just watch and pull from them. I've been using import sqlite3 so far, dumping sql from sqlite, using it to create the Postgres

Re: [sqlalchemy] Newbie question

2011-07-27 Thread Michael Bayer
On Jul 27, 2011, at 3:21 PM, Kent Tenney wrote: Howdy, I'm aggregating data from several Sqlite files into a Postgres db. The sqlite files are storage for several apps I use: Shotwell, Firefox, Zotero, Banshee ... I just watch and pull from them. I've been using import sqlite3 so far,

[sqlalchemy] Newbie Question - Identity Mapper Issue

2009-01-14 Thread koranthala
Hi, Does SqlAlchemy query call __init__ on the mapped object? i.e. Say I have mapped the object to table as follows: mapper(Obj, Table) Now, table contains: index integer x integer y integer And Obj is defined as Class Obj: def __init__(self, x, y):

[sqlalchemy] Newbie question

2008-07-04 Thread jrpfinch
I have just started using Python and TurboGears with SQLAlchemy and I think its great so far. I am working with an already-created database and am wondering what the best way is to represent the relationships between the recurring_task and employee_status table: employee_statuses =

[sqlalchemy] Newbie question: sAsync maintained? In use?

2008-02-08 Thread Dwig
'm just getting started with SA, and I'll want to be using it in a back-end server with an existing mssql database. I'm considering using Twisted as the basis for the server, and I've looked a bit into using sAsync. I've had trouble getting the Twisted XML-RPC Server Example to run, and that

[sqlalchemy] Newbie question: Too many connections

2007-08-20 Thread mc
Hi, I keep getting The error: DBAPIError: (Connection failed) (OperationalError) (1040, 'Too many connections'). At no time do I really need more than a few connections so I am doing something basically wrong. From reading the doc I concluded that pooling in the simple cases is automatic. I must

[sqlalchemy] Newbie question about transactions

2007-07-28 Thread mc
In the following code, I intended that nothing will be inserted into the table because the transaction fails and is rolled back. What actually happens is that the first insert is not rolled back because it s committed by itself. What is the correct way to achieve my goal? TIA from sqlalchemy

[sqlalchemy] Newbie question about select statement

2007-02-13 Thread Cristiano Paris
I everyone. I'm pretty new to SQLAlchemy and never done much sql-related work in the past as well so this could possibly be a silly question. Suppose I've a table with a huge number of records. Now, I'd like to access this table randomly through a list-like interface of a Python class instance,