[sqlalchemy] Re: Tracking Last Update timestamp for models

2009-08-25 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Stephen Hansen Sent: 25 August 2009 07:34 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Tracking Last Update timestamp for models Hi all. I'm working on converting

[sqlalchemy] Re: from a sqlalchemy table to the corresponding CREATE TABLE sql code

2009-08-26 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Michele Simionato Sent: 26 August 2009 13:40 To: sqlalchemy Subject: [sqlalchemy] from a sqlalchemy table to the corresponding CREATE TABLE sql code A part from setting

[sqlalchemy] Re: Curious Problem

2009-09-02 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of gizli Sent: 02 September 2009 04:45 To: sqlalchemy Subject: [sqlalchemy] Curious Problem Hi all, I just discovered something weird when doing concurrency testing with my

[sqlalchemy] Re: How to bypass scoped_session?

2009-09-08 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Eloff Sent: 08 September 2009 04:40 To: sqlalchemy Subject: [sqlalchemy] How to bypass scoped_session? Hi, I'm using scoped_session in my pylons app, but sometimes I have

[sqlalchemy] Re: How to bypass scoped_session?

2009-09-09 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Eloff Sent: 08 September 2009 21:34 To: sqlalchemy Subject: [sqlalchemy] Re: How to bypass scoped_session? On Sep 8, 3:47 am, King Simon-NFHD78 simon.k...@motorola.com wrote

[sqlalchemy] Re: getting data from primary keys

2009-09-15 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of C.T. Matsumoto Sent: 15 September 2009 07:21 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re: getting data from primary keys That did the trick. Thanks a lot.

[sqlalchemy] Re: Pre-commit validation spanning multiple tables/ORM classes

2009-09-22 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Randall Nortman Sent: 22 September 2009 16:31 To: sqlalchemy Subject: [sqlalchemy] Pre-commit validation spanning multiple tables/ORM classes [SNIP] So if I do this with

[sqlalchemy] Re: unexpected chained relations and append behaviour

2009-09-23 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Crusty Sent: 23 September 2009 15:48 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] unexpected chained relations and append behaviour Hello everyone, I have a

[sqlalchemy] Re: unexpected chained relations and append behaviour

2009-09-24 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Crusty Sent: 24 September 2009 16:16 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re: unexpected chained relations and append behaviour Hello Simon, thanks for

[sqlalchemy] Re: Bypass checking to database structure (metadata.create_all)

2009-10-01 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Christian Démolis Sent: 01 October 2009 10:40 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Bypass checking to database structure (metadata.create_all) Hi again,

[sqlalchemy] Re: Select from multiple databases

2009-10-02 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of kkapron Sent: 01 October 2009 21:27 To: sqlalchemy Subject: [sqlalchemy] Select from multiple databases Hello, I'm a beginner in sqlalchemy and I've got a problem with select

[sqlalchemy] Re: Duck-typing style of relations

2009-10-09 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Yannick Gingras Sent: 09 October 2009 14:43 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Duck-typing style of relations Greetings Alchemists, this is more of a

[sqlalchemy] Re: ORM Many to Many Across Two Databases

2009-10-14 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Luke Arno Sent: 14 October 2009 16:41 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re: ORM Many to Many Across Two Databases It looks like if I put the relation on the

[sqlalchemy] Re: bad result when querying for null values (in pk at least)

2009-10-15 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Mike Conley Sent: 15 October 2009 14:43 To: sqlalchemy@googlegroups.com Cc: SQLElixir Subject: [sqlalchemy] Re: bad result when querying for null values (in pk at least)

[sqlalchemy] Re: Declerative Relation trouble

2009-10-15 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Martijn Moeling Sent: 15 October 2009 14:42 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Declerative Relation trouble Hi All, I am having a very bad day (or two

[sqlalchemy] Re: Declerative Relation trouble

2009-10-15 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Martijn Moeling Sent: 15 October 2009 15:38 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re: Declerative Relation trouble Hi Simon, (I do things a little

[sqlalchemy] Re: Declerative Relation trouble

2009-10-15 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Martijn Moeling Sent: 15 October 2009 15:55 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re: Declerative Relation trouble I downgraded SQLA to version 0.5.5, no

[sqlalchemy] Re: [runs one one installation not on the other] Declerative Relation trouble

2009-10-15 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Martijn Moeling Sent: 15 October 2009 16:21 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re:[runs one one installation not on the other] Declerative Relation trouble

[sqlalchemy] Re: [runs one one installation not on the other] Declerative Relation trouble

2009-10-15 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Martijn Moeling Sent: 15 October 2009 16:27 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re: [runs one one installation not on the other] Declerative Relation trouble

[sqlalchemy] Re: column label and order by

2009-11-17 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of rajasekhar911 Sent: 17 November 2009 11:32 To: sqlalchemy Subject: [sqlalchemy] Re: column label and order by anyone?? On Nov 14, 6:48 pm, rajasekhar911

RE: [sqlalchemy] dynamic_loader

2010-01-25 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of werner Sent: 25 January 2010 13:37 To: sqlalchemy@googlegroups.com Subject: Re: [sqlalchemy] dynamic_loader On 24/01/2010 16:57, werner wrote: ... Next thing is to make

RE: [sqlalchemy] Re: Is it possible to narrow down the generated query in SQLAlchemy if it was created via query_property?

2010-01-26 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Boda Cydo Sent: 26 January 2010 01:35 To: sqlalchemy Subject: [sqlalchemy] Re: Is it possible to narrow down the generated query in SQLAlchemy if it was created via

RE: [sqlalchemy] any way to pre cook a monster query?

2010-01-26 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Chris Withers Sent: 26 January 2010 09:13 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] any way to pre cook a monster query? Hi All, I have a few monster queries like

RE: [sqlalchemy] Map to Arbitrary Select Using Raw SQL

2010-01-27 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Michael Bayer Sent: 27 January 2010 16:31 To: sqlalchemy@googlegroups.com Subject: Re: [sqlalchemy] Map to Arbitrary Select Using Raw SQL Michael Chambliss wrote: Hey Michael

RE: [sqlalchemy] problem when executing multiple insert statements and boolean type

2010-01-29 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Manlio Perillo Sent: 29 January 2010 13:15 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] problem when executing multiple insert statements and boolean type -BEGIN

RE: [sqlalchemy] Getting useful error messages

2010-02-03 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Adam Tauno Williams Sent: 03 February 2010 12:17 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Getting useful error messages Attempting, again, to get a declarative

RE: [sqlalchemy] Using a arbitrary select mapper/class in a relation - is this allowed?

2010-02-04 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of werner Sent: 04 February 2010 09:41 To: sqlalchemy@googlegroups.com Subject: Re: [sqlalchemy] Using a arbitrary select mapper/class in a relation - is this allowed? On

RE: [sqlalchemy] Another tutorial!

2010-02-04 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Mike Driscoll Sent: 04 February 2010 03:34 To: sqlalchemy Subject: [sqlalchemy] Another tutorial! Hi, I just finished up a tutorial series on SqlAlchemy that I thought I'd

RE: [sqlalchemy] Re: Another tutorial!

2010-02-04 Thread King Simon-NFHD78
Mike Driscoll wrote: On Feb 4, 8:30 am, Mike Driscoll kyoso...@gmail.com wrote: On Feb 4, 4:24 am, King Simon-NFHD78 simon.k...@motorola.com wrote: [SNIP] Not a serious blunder, but I think there may be a small mistake in part 2, where you describe updating an email address

RE: [sqlalchemy] Re: Another tutorial!

2010-02-04 Thread King Simon-NFHD78
Mike Driscoll wrote: Thanks Simon! That made sense. I've fixed my example to match what you said. Sorry about that. - Mike No problem. I'm afraid you still have a typo though. You have: addresses[0].email_address = Address(pr...@marvel.com) Whereas you want:

RE: [sqlalchemy] reflecting schema just on a single table

2010-02-24 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Paul Rigor (uci) Sent: 24 February 2010 00:23 To: sqlalchemy Subject: [sqlalchemy] reflecting schema just on a single table Hi, Is there anyway to use a metadata object just

RE: [sqlalchemy] Oracle Views/DatabaseLink and declarative

2010-02-24 Thread King Simon-NFHD78
Christian Klinger wrote: [SNIP] Ok now a second table comes into the game. The name of this table is BTeilnehmer. As you can see this table has a ForeignKey to Unternehmen.mnr. I use a seperate metadata BaseC for it because i want to create this table. Hi, I don't know if the seperate

RE: [sqlalchemy] extended use of VALUES command

2010-03-02 Thread King Simon-NFHD78
Manlio Perillo wrote: Hi. Is it possible, in SQLAlchemy, to express this query? CREATE TEMP TABLE foo ( x INTEGER, y INTEGER ); INSERT INTO foo VALUES (10, 11); INSERT INTO foo VALUES (1, 2); manlio= SELECT * FROM foo WHERE (x, y) in (VALUES (1, 2), (3, 4)); x | y -

RE: [sqlalchemy] recommended declarative method design pattern for sessions

2010-03-22 Thread King Simon-NFHD78
Daniel Robbins wrote: Hi All, One of the things that doesn't seem to be covered in the docs, and that I'm currently trying to figure out, is the recommended design pattern to use for managing sessions from declarative methods calls. Consider a declarative class User, where I want to

RE: [sqlalchemy] Re: SQLAlchemy, Twisted, and sAsync

2010-03-26 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Matthew Williams Sent: 26 March 2010 12:10 To: sqlalchemy@googlegroups.com; twisted-pyt...@twistedmatrix.com Subject: [sqlalchemy] Re: SQLAlchemy, Twisted, and sAsync On Mar

[sqlalchemy] Re: fully qualified column names in RowProxy

2007-11-27 Thread King Simon-NFHD78
It may not help in your situation, but did you know that you can also index the row with the Column instances themselves Ie: row[table.c.column] Simon -Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Yuri Pimenov Sent: 27 November 2007

[sqlalchemy] Re: concurent modification

2007-11-28 Thread King Simon-NFHD78
imgrey wrote: Based on my observations it happens only with concurent inserts/ updates. One thread : {{{ f_table.insert().execute() session.flush() transaction = session.begin() nested = session.begin_nested() try: f_table.insert().execute() except IntegrityError: #record is

[sqlalchemy] Re: IMPORTANT: Does SA caches objects in memory forever?

2007-12-07 Thread King Simon-NFHD78
Felix Schwarz wrote: I have a question which I think is similar enough to be asked in the same thread: I have a set of quite simple migration scripts which us SQLAlchemy 0.4 and Elixir 0.4. I do extract data from the old legacy (MySQL) database with SQLAlchemy and put this data into

[sqlalchemy] Re: Matching a DateTime-field

2007-12-11 Thread King Simon-NFHD78
It may not matter to you, but I wouldn't have thought this would be a very efficient query, because the database is going to have to call the DATE_FORMAT function twice for every row in your table. I would have thought a more efficient version would be one that asks for all rows between the first

[sqlalchemy] Iterating over mapped properties

2007-12-11 Thread King Simon-NFHD78
Hi, I used to be able to iterate over mapper.properties.items() to get the name of each mapped property along with the object that implements it. However, in 0.4.1, trying to do this results in a NotImplementedError telling me to use iterate_properties and get_property instead, but I can't see a

[sqlalchemy] Column defaults in MapperExtension.after_insert

2007-12-11 Thread King Simon-NFHD78
svilen wrote: On Tuesday 11 December 2007 13:13:37 King Simon-NFHD78 wrote: Hi, I used to be able to iterate over mapper.properties.items() to get the name of each mapped property along with the object that implements it. However, in 0.4.1, trying to do this results

[sqlalchemy] Convert JOIN to WHERE for old MySQLs

2007-12-12 Thread King Simon-NFHD78
Hi, I'm connecting to an ancient version of MySQL (3.23.58) that (as far as I can tell) doesn't support basic JOIN table ON condition syntax Ie. this gives a syntax error: SELECT * FROM productversions pv JOIN producttypes pt ON pv.producttype = pt.producttype Whereas this is fine:

[sqlalchemy] Re: LIMIT in queries

2007-12-12 Thread King Simon-NFHD78
Felix Schwarz wrote: Hi, after reading the docs [1] I thought that something like session.query(User).filter(User.c.id 3)[0] should work even if the filter clause does not return any rows. But - compliant with Python's behavior - SQLAlchemy raises an IndexError. (...) File

[sqlalchemy] Re: Column defaults in MapperExtension.after_insert

2007-12-12 Thread King Simon-NFHD78
Michael Bayer wrote: On Dec 11, 2007, at 10:07 AM, King Simon-NFHD78 wrote: I assume the problem is that my date_created column isn't immediately available at the 'after_insert' stage, because it is generated in the SQL INSERT statement, but hasn't been read back from

[sqlalchemy] Re: Convert JOIN to WHERE for old MySQLs

2007-12-12 Thread King Simon-NFHD78
Michael Bayer wrote On Dec 12, 2007, at 9:04 AM, King Simon-NFHD78 wrote: Hi, I'm connecting to an ancient version of MySQL (3.23.58) that (as far as I can tell) doesn't support basic JOIN table ON condition syntax Ie. this gives a syntax error: SELECT * FROM

[sqlalchemy] Re: Convert JOIN to WHERE for old MySQLs

2007-12-12 Thread King Simon-NFHD78
Jason kirtland wrote: King Simon-NFHD78 wrote: Hi, I'm connecting to an ancient version of MySQL (3.23.58) that (as far as I can tell) doesn't support basic JOIN table ON condition syntax Ie. this gives a syntax error: SELECT * FROM productversions pv JOIN

[sqlalchemy] Re: Schema display

2008-01-07 Thread King Simon-NFHD78
sqlalchemy_schemadisplay.py is not part of the SQLAlchemy distribution - it's a separate script attached to that wiki page. You can download it from the link at the bottom of the page. Hope that helps, Simon -Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL

[sqlalchemy] Re: Filter by year in datetime column

2008-01-18 Thread King Simon-NFHD78
Would create_date = '2007-01-01' and create_date '2008-01-01' be acceptable? If so, something like this should work from sqlalchemy import and_ from datetime import date data = Table.query().filter(and_([Mikropost.c.create_date = date(2007, 1, 1),

[sqlalchemy] Re: Two SqlAlchemy versions installed together

2008-01-23 Thread King Simon-NFHD78
If you're using easy_install to install them, you should be able to install them with the '-m' (--multiversion) switch. See: http://peak.telecommunity.com/DevCenter/EasyInstall#command-line-options Choosing the version you want to use in your application is then done like this: import

[sqlalchemy] Re: How do I Instantiate a class with an Auto-assigned Key ID

2008-02-04 Thread King Simon-NFHD78
Hi, If your database is set up to generate auto-incrementing primary keys on INSERT (such as a MySQL auto-incrementing column), then SA will retrieve the new value when the object is flushed to the database. When the object is constructed, the primary key will be None until you flush the

[sqlalchemy] Re: Search in object list by field value

2008-02-08 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of maxi Sent: 08 February 2008 14:30 To: sqlalchemy Subject: [sqlalchemy] Re: Search in object list by field value Thanks Simon, I was doing of that manner. Now, is advisable implement

[sqlalchemy] Re: Search in object list by field value

2008-02-08 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of maxi Sent: 08 February 2008 13:47 To: sqlalchemy Subject: [sqlalchemy] Re: Search in object list by field value On 8 feb, 09:58, svilen [EMAIL PROTECTED] wrote: On Friday 08 February

[sqlalchemy] Re: schema changes

2008-02-14 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Chris Withers Sent: 13 February 2008 13:51 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re: schema changes Michael Bayer wrote: What if they exist but don't match the spec

[sqlalchemy] Re: Pre-commit hooks

2008-05-14 Thread King Simon-NFHD78
Yannick Gingras wrote: Greetings Alchemists, Is it possible to define a hook in a mapped class that will be called to test the sanity of an instance before it gets committed? As an example: class Item(object): def _pre_commit(self): assert (self.dry_weight +

[sqlalchemy] Re: sqlalchemy in virtualenv Instructions

2008-06-10 Thread King Simon-NFHD78
Lukasz Szybalski wrote: I have mysqldb installed in the system wide install how do I tell virtualenv to use it? I don't see a need to install it in virtualenv again so I guess I just have to givea right path? How, and in which file? Thanks, Lucas File

[sqlalchemy] Re: select db engine with create_session

2008-06-10 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of lilo Sent: 10 June 2008 17:23 To: sqlalchemy Subject: [sqlalchemy] select db engine with create_session can someone tell me how session chooses the right db engine to insert records in

[sqlalchemy] Re: text

2008-06-11 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of jack2318 Sent: 11 June 2008 17:50 To: sqlalchemy Subject: [sqlalchemy] text I tried very simple test: s = text(SELECT COUNT(*) FROM table WHERE field LIKE 'something') count =

[sqlalchemy] Re: sharding id_chooser query_chooser

2008-06-27 Thread King Simon-NFHD78
Lilo wrote: My understanding of this query_chooser is that it's used when you want to execute orm's sql rather than raw sql. I don't quite understand what is visit_binary function do from attribute_shard.py example. What does it mean binary.operator, binary.left, binary.right.clause and

[sqlalchemy] Re: Cannot delete persisted object which is not in current session

2008-07-01 Thread King Simon-NFHD78
Tai Tran wrote: [snip] class PC(object): ... def destroySelf(self): db_session = Session() ... for port in self.ports: port.destroySelf() ... db_session.delete(self) ... class Port(object): ...

[sqlalchemy] Re: M2M relationship

2008-07-14 Thread King Simon-NFHD78
Heston wrote: [SNIP] Above you talk about a global module in the application which creates the Base and metadata, but I don't understand how these can then be accessed by other classes around the application? Do you have any good sample code or a link to a decent tutorial? Seems

[sqlalchemy] Re: How to turn off UPDATE on child objects when deleting parent object

2008-09-30 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Randy Syring Sent: 30 September 2008 07:17 To: sqlalchemy Subject: [sqlalchemy] Re: How to turn off UPDATE on child objects when deleting parent object On Sep 30, 2:14 am, Randy Syring

[sqlalchemy] Re: how to print a constructed query with it's parameters?

2008-10-15 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of alex bodnaru Sent: 15 October 2008 11:00 To: SQLAlchemy Subject: [sqlalchemy] how to print a constructed query with it's parameters? hello friends, in order to debug my code, i

[sqlalchemy] Re: select where field=max(field)

2008-11-10 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of John Hunter Sent: 10 November 2008 14:07 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re: select where field=max(field) On Mon, Nov 10, 2008 at 4:33 AM, King Simon-NFHD78

[sqlalchemy] Re: Memory leak - is session.close() sufficient?

2008-11-10 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of joelanman Sent: 10 November 2008 00:21 To: sqlalchemy Subject: [sqlalchemy] Re: Memory leak - is session.close() sufficient? Thanks for all the advice - I've changed my unicode settings

[sqlalchemy] Re: select where field=max(field)

2008-11-10 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of John Hunter Sent: 08 November 2008 05:09 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re: select where field=max(field) [SNIP] Here is a query that lists the sum(pnl) for each

[sqlalchemy] Re: select where field=max(field)

2008-11-11 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of John Hunter Sent: 11 November 2008 01:54 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re: select where field=max(field) On Mon, Nov 10, 2008 at 11:10 AM, Michael Bayer [EMAIL

[sqlalchemy] Re: Using deferred with declarative

2008-11-14 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Allen Bierbaum Sent: 14 November 2008 16:40 To: sqlalchemy Subject: [sqlalchemy] Re: Using deferred with declarative Does anyone have any ideas on this? Does declarative simply not

[sqlalchemy] Re: Info needed regarding the use of cascade

2008-11-18 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ---[EMAIL PROTECTED]@il06exr02.mot.com Sent: 18 November 2008 10:04 To: sqlalchemy Subject: [sqlalchemy] Re: Info needed regarding the use of cascade Thank you Michael , you

[sqlalchemy] Re: ORM mapping with Elixir compared to raw cursor query

2008-11-21 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of SinJax Sent: 21 November 2008 10:43 To: sqlalchemy Subject: [sqlalchemy] Re: ORM mapping with Elixir compared to raw cursor query [SNIP] sql = SELECT annotations.id AS

[sqlalchemy] Re: New instance ExtraStat with identity key (...) conflicts with persistent instance ExtraStat

2008-11-28 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Doug Farrell Sent: 28 November 2008 18:22 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] New instance ExtraStat with identity key (...) conflicts with persistent instance ExtraStat

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

2008-12-05 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Faheem Mitha Sent: 04 December 2008 20:43 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] returning primary key of object without know what it is called. Hi, I'm trying to

[sqlalchemy] Re: Create tables with metadata

2008-12-12 Thread King Simon-NFHD78
SQLALchemy doesn't (directly) contain functions for altering tables. You may be interested in the sqlalchemy-migrate project: http://code.google.com/p/sqlalchemy-migrate/ The first example on this page shows how to add a column:

[sqlalchemy] Re: Efficient dictificationof result sets

2008-12-19 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Andreas Jung Sent: 19 December 2008 06:30 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re: Efficient dictificationof result sets On 19.12.2008 2:57 Uhr, Michael Bayer

[sqlalchemy] Re: how to use model.py file across different applications

2009-01-20 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of abhishek Sent: 20 January 2009 14:26 To: sqlalchemy Subject: [sqlalchemy] how to use model.py file across different applications Hello all, I have been using SQL Alchemy

[sqlalchemy] Re: passing tuple argument into sqlalchemy.sql.text string

2009-01-21 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Faheem Mitha Sent: 20 January 2009 22:05 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] passing tuple argument into sqlalchemy.sql.text string Hi, I've got a

[sqlalchemy] Re: Questions about polymorphic mappers

2007-01-12 Thread King Simon-NFHD78
Michael Bayer wrote: i think using the polymorphic_map is OK. i downplayed its existence since I felt it was confusing to people, which is also the reason i made the _polymorphic_map argument to mapper private; it was originally public. but it seemed like it was producing two ways of

[sqlalchemy] Re: Questions about polymorphic mappers

2007-01-15 Thread King Simon-NFHD78
Micheal Bayer wrote: id rather just add another plugin point on MapperExtension for this, which takes place before the polymorphic decision stage at the top of the _instance method, like get_polymorphic_identity(). that way you could do all of this stuff cleanly in an extension (and id do

[sqlalchemy] Re: Questions about polymorphic mappers

2007-01-18 Thread King Simon-NFHD78
Michael Bayer wrote: Simon King wrote: [requirements for instances returned from MapperExtension.create_instance] at this point the entity_name should get set after your custom create_instance is called (at least thats in the trunk). init_attr is not required, it pre-sets attributes on

[sqlalchemy] Using .label() on boolean expressions

2007-01-19 Thread King Simon-NFHD78
Hi, I don't know if this is valid SQL, but MySQL seems to accept it... I'd like to write a query that looks like: SELECT s.result LIKE 'Pass%' AS pass ... Which would return 1 or 0 for each row depending on whether the result column begins with Pass. In SQLAlchemy this would become:

[sqlalchemy] Re: Using .label() on boolean expressions

2007-01-19 Thread King Simon-NFHD78
Simon King wrote: I don't know if this is valid SQL, but MySQL seems to accept it... I'd like to write a query that looks like: SELECT s.result LIKE 'Pass%' AS pass ... Which would return 1 or 0 for each row depending on whether the result column begins with Pass. Another way I

[sqlalchemy] Re: iteration over mapper

2007-01-31 Thread King Simon-NFHD78
Jose Soares wrote: Hi all, Probably this is a stupid question, :-[ but I don't understand how to iterate an object mapper to get fields value. --- user = session.query(User).select(id=1) for j in user.c: print j.name logname id password for j in user.c: print

[sqlalchemy] Re: new setuptools vs local SA copy

2007-02-06 Thread King Simon-NFHD78
Rick Morrison wrote: I keep two versions of SA installed here, one is a stable version installed in the Python site-packages folder, and one is current trunk with some local patches for testing. I used to be able to run tests and programs using the local version by just inserting the

[sqlalchemy] Re: SelectResults, counts and one-to-many relationships

2007-02-06 Thread King Simon-NFHD78
Michael Bayer wrote: I added distinct() to selectresults as a method and made the unit test a little clearer (since i dont like relying on the selectresults mod)... q = sess.query(Department) d = SelectResults(q) d =

[sqlalchemy] Re: Lazy loading advantages and disadvantages

2007-02-22 Thread King Simon-NFHD78
Adam M Peacock wrote: Is there a difference in the SQL executed when using lazy vs eager loading? Specifically, if I use eager loading will everything be queried at once with a more efficient join, or will it still use the lazy style (as far as I understand it) of generating a ton

[sqlalchemy] Re: How do I tell if an object has been INSERTed or UPDATEd?

2007-02-26 Thread King Simon-NFHD78
Marco Mariani wrote: Simon Willison wrote: I've got a bit of code that looks like this: session = get_session() session.save(obj) session.flush() You can see what's going to be inserted/updated/deleted by accessing session.new, session.dirty, session.deleted

[sqlalchemy] Re: SQA failing on table creation

2007-03-02 Thread King Simon-NFHD78
percious wrote: Here is the dump: ...snip... sqlalchemy.exceptions.SQLError: (OperationalError) (1071, 'Specified key was too long; max key length is 999 bytes') '\nCREATE TABLE `Album` (\n\tid INTEGER NOT NULL AUTO_INCREMENT, \n\tname VARCHAR(128), \n\tdirectory VARCHAR(512),

[sqlalchemy] Re: Associations in a cleaner way

2007-03-05 Thread King Simon-NFHD78
Knut Aksel Røysland wrote: [snip] However, an instance of D also needs a reference to an instance of C. If the appropriate instance of C exists in the database (or is pending to go into it), I want to pick this one, or otherwise create a new instance of C. What I am looking for is

[sqlalchemy] Re: Polymorphic collections / ticket #500

2007-03-06 Thread King Simon-NFHD78
I wanted to do something like this in the past, and in the end, rather than using polymorphic mappers it made more sense to create a MapperExtension which overrides create_instance. In create_instance you can examine your 'typ' column to decide what class to create, selecting one of your

[sqlalchemy] Table being removed from nested query

2007-03-06 Thread King Simon-NFHD78
Hi, I have a problem in which a table is being removed from the FROM clause of a nested query. The attached file should show the problem, which I've tested on 0.3.5 and rev 2383. In the example, there are two tables, department and employee, such that one department has many employees. The inner

[sqlalchemy] Re: table name bind param

2007-03-15 Thread King Simon-NFHD78
tml wrote: also to clarify, the text actually has :table_name used in many other places: t = metadata.engine.text(LOCK TABLE :table_name WRITE; UPDATE :table_name SET rgt=rgt + 2 WHERE rgt :insert_node_val and parent_id = :parent_id;

[sqlalchemy] Inconsistent results in session.flush()

2007-03-16 Thread King Simon-NFHD78
Hi, I'm having a problem where the results of session.flush() vary from one run to another of my test suite. The unit of work transaction dump is significantly different from one run to the next, similar to the issue in ticket 461. I haven't managed to make a test case small enough to post to

[sqlalchemy] Re: Inconsistent results in session.flush()

2007-03-16 Thread King Simon-NFHD78
what pairs of classes the UOW perceives as dependent on each other. On Mar 16, 2007, at 6:59 AM, King Simon-NFHD78 wrote: Hi, I'm having a problem where the results of session.flush() vary from one run to another of my test suite. The unit of work transaction dump

[sqlalchemy] Re: Inconsistent results in session.flush()

2007-03-19 Thread King Simon-NFHD78
Michael Bayer wrote: On Mar 17, 2007, at 11:39 AM, Simon King wrote: I had assumed that post_update was only necessary when you are inserting two rows that are mutually dependent, but in this case I wasn't inserting either a ReleaseLine or a Label. I suppose post_update can

[sqlalchemy] Re: Using mapper with custom select creates unneeded subquery

2007-03-22 Thread King Simon-NFHD78
This caught me out a couple of weeks ago, and I've seen a couple of other similar questions as well. You need to add 'correlate=False' to the nested select. I wonder if this should be added to the FAQ? Hope that helps, Simon -Original Message- From: sqlalchemy@googlegroups.com

[sqlalchemy] Re: Confused by foreign_keys argument

2007-03-28 Thread King Simon-NFHD78
to model. On Mar 28, 2007, at 10:39 AM, King Simon-NFHD78 wrote: a_table = Table('a', metadata, Column('id', Integer, primary_key=True), Column('name', String(16)), ) b_table = Table

[sqlalchemy] Re: offset limit on query with relations

2007-04-05 Thread King Simon-NFHD78
Huy wrote: Hi, When using the generative limit() offset() or order_by calls on mapper query, the sql generated looks weird. I get something like select table1.* table2.* from (select table1a.id from table1a limit 20 offset 0 order by table1.col) as table_row, table1 join

[sqlalchemy] Re: 'PropertyLoader' object has no attribute 'strategy'

2007-04-11 Thread King Simon-NFHD78
Roger Demetrescu wrote: On 4/11/07, King Simon-NFHD78 [EMAIL PROTECTED] wrote: I've got no idea about the source of the problem, but it would probably be helpful if you could provide stack traces from the exceptions, if that's possible. Do you mean using the traceback module

[sqlalchemy] Re: sqlalchemy.orm.attributes.InstrumentedList

2007-04-12 Thread King Simon-NFHD78
Disrupt07 wrote What is sqlalchemy.orm.attributes.InstrumentedList? I need to use the sqlalchemy.orm.attributes.InstrumentedList type in my Python controller methods and need to check if the type of another object is of type sqlalchemy.orm.attributes.InstrumentedList. How can I do

[sqlalchemy] Re: SELECT LIKE

2007-04-13 Thread King Simon-NFHD78
Disrupt07 wrote: I have a table storing users' info. table: userinfo columns: name, surname, age, location, ... I need to query this table using SQLAlchemy's ORM methods (e.g. select(), select_by(), get_by()). The query should be like SELECT * FROM userinfo WHERE name LIKE 'Ben%'

[sqlalchemy] Re: SELECT LIKE

2007-04-13 Thread King Simon-NFHD78
Disrupt07 wrote @Simon Thanks. But what is your_query? Is it SQLAlchemy or pure SQL? It is a Query object, as described here: http://www.sqlalchemy.org/docs/datamapping.html If you haven't read them yet, I'd recommend working through a tutorial - I found this one really helpful:

<    1   2   3   >