RE: [sqlalchemy] flush(), save(), delete()

2010-04-15 Thread King Simon-NFHD78
Jo wrote: [SNIP] and- In [13]: aa=Anagrafica.get(111) In [14]: aa.delete() In [15]: aa.flush() - but in version 0.6 I can't find flush(), save(),

RE: [sqlalchemy] further restricting a query provided as raw sql

2010-04-15 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Mariano Mara Sent: 15 April 2010 16:20 To: sqlalchemy Subject: Re: [sqlalchemy] further restricting a query provided as raw sql Excerpts from Chris Withers's message of Thu

RE: [sqlalchemy] cls._state / cls._state.get('original') class 'sqlalchemy.orm.attributes.CommittedState'

2010-04-16 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of jose soares Sent: 16 April 2010 11:03 To: sqlalchemy@googlegroups.com Subject: Re: [sqlalchemy] cls._state / cls._state.get('original') class

RE: [sqlalchemy] Is the mapper must have a primary_key?

2010-04-19 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Gaicitadie Sent: 16 April 2010 20:06 To: sqlalchemy Subject: [sqlalchemy] Is the mapper must have a primary_key? #!/usr/bin/python # -*- coding: UTF-8 -*- from sqlalchemy

RE: [sqlalchemy] Storing Nested Lists

2010-04-26 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of greg Sent: 25 April 2010 22:59 To: sqlalchemy Subject: [sqlalchemy] Storing Nested Lists Hi All, I'm new to sqlalchemy. I've been reading the documentation and group

RE: [sqlalchemy] session lifecycle and wsgi

2010-04-28 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Chris Withers Sent: 28 April 2010 14:37 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] session lifecycle and wsgi Hi All, I'm still trying to get an answer on this...

RE: [sqlalchemy] declarative commit hook - onCommit()?

2010-04-28 Thread King Simon-NFHD78
Daniel Robbins wrote: On Wed, Apr 28, 2010 at 10:04 AM, Chris Withers ch...@simplistix.co.uk wrote: Daniel Robbins wrote: Let's say that when a database record is added or updated, I need to perform some arbitrary action (in my case, ensuring that data in other tables is

RE: [sqlalchemy] Use a foreign key mapping to get data from the other table using Python and SQLAlchemy.

2010-05-27 Thread King Simon-NFHD78
Az wrote: [SNIP] The following code maps these classes to respective database tables. # SQLAlchemy database transmutation engine = create_engine('sqlite:///:memory:', echo=False) metadata = MetaData() customers_table = Table('customers', metadata,

RE: [sqlalchemy] Re: For each begin_nested() call, a corresponding rollback() or commit() must be issued.

2010-05-28 Thread King Simon-NFHD78
Kent wrote: [SNIP] I'm fine with how SQLA is designed, it isn't really a SQLA issue, I was just appealing to you to see if you could think of a workaround I believe the problem is in the framework tools we are using, whether it is Zope or TG. (I've posted to zope group now to see if

RE: [sqlalchemy] reflecting existing databases with no a priori knowledge of their structure

2010-06-03 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Harry Percival Sent: 03 June 2010 16:24 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] reflecting existing databases with no a priori knowledge of their structure Hi

[sqlalchemy] SA on MySQL 3.23

2010-06-03 Thread King Simon-NFHD78
Hi, According to sqlalchemy/dialects/mysql/base.py, MySQL v3.23 should be supported in some form. However, with SA 0.6.1 and MySQL 3.23.58, I get the following error: import sqlalchemy as sa e = sa.create_engine('mysql://user:passw...@host') e.execute('select Hello World') Traceback (most

RE: [sqlalchemy] SA on MySQL 3.23

2010-06-04 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Michael Bayer Sent: 03 June 2010 19:38 To: sqlalchemy@googlegroups.com Subject: Re: [sqlalchemy] SA on MySQL 3.23 On Jun 3, 2010, at 1:15 PM, King Simon-NFHD78 wrote: Hi

RE: [sqlalchemy] SA on MySQL 3.23

2010-06-04 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Michael Bayer Sent: 04 June 2010 14:42 To: sqlalchemy@googlegroups.com Subject: Re: [sqlalchemy] SA on MySQL 3.23 On Jun 4, 2010, at 6:54 AM, King Simon-NFHD78 wrote

RE: [sqlalchemy] help please

2010-06-10 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Aref Sent: 10 June 2010 02:40 To: sqlalchemy Subject: [sqlalchemy] help please Hello All, I just began learning sqlalchemy and am not quite used to it yet so please excuse

RE: [sqlalchemy] Referential integrity actions are not doing what I want

2010-06-22 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of exhuma.twn Sent: 22 June 2010 14:27 To: sqlalchemy Subject: [sqlalchemy] Referential integrity actions are not doing what I want Hi, I have a table of items, where each

RE: [sqlalchemy] cross-database joins with MySQL

2010-06-29 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Chris Withers Sent: 29 June 2010 10:28 To: sqlalchemy@googlegroups.com Subject: Re: [sqlalchemy] cross-database joins with MySQL Michael Bayer wrote: We have engines set up

RE: [sqlalchemy] models in different packages, often declaratively defined

2010-07-02 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Chris Withers Sent: 01 July 2010 19:17 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] models in different packages, often declaratively defined Hi All, Suppose I

RE: [sqlalchemy] Using the declarative base across projects

2010-07-08 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of thatsanicehatyouh...@mac.com Sent: 07 July 2010 20:33 To: sqlalchemy@googlegroups.com Subject: Re: [sqlalchemy] Using the declarative base across projects Hi Lance, Thanks

RE: [sqlalchemy] Comparable properties

2010-07-08 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Chris Withers Sent: 08 July 2010 09:28 To: sqlalchemy@googlegroups.com Subject: Re: [sqlalchemy] Comparable properties Oliver Beattie wrote: @property def

RE: [sqlalchemy] Problem with Joined Table inheritance

2010-07-13 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Jules Stevenson Sent: 13 July 2010 15:01 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Problem with Joined Table inheritance Apologies for any stupidity, but I'm

RE: [sqlalchemy] Re: open session blocks metadata create_all method

2010-07-29 Thread King Simon-NFHD78
On Wed, 28 Jul 2010 15:17:09 +0530 (IST), Faheem Mitha fah...@email.unc.edu wrote: Hi, When calling create_all on a metadata instance after a session has alrady been opened causes the create_all to hang, I assume because the session is blocking the create_all. Is there

RE: [sqlalchemy] Re: To select only some columns from some tables using session object, relation many-to-many

2010-08-04 Thread King Simon-NFHD78
Alvaro Reinoso wrote: It works out, thank you! How could I just retrieve some columns from both tables? For example, if I try to select some columns from Item and Channel, I get class 'sqlalchemy.util.NamedTuple' when I'd like to get a channel type with its items: result =

RE: [sqlalchemy] Which columns changing during orm commit?

2010-08-20 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Michael Hipp Sent: 19 August 2010 23:39 To: sqlalchemy@googlegroups.com Subject: Re: [sqlalchemy] Which columns changing during orm commit? On 8/19/2010 5:24 AM, Chris Withers

RE: [sqlalchemy] Session.merge and multiple databases

2010-08-25 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Raf Geens Sent: 25 August 2010 16:48 To: sqlalchemy@googlegroups.com Subject: Re: [sqlalchemy] Session.merge and multiple databases On 25/08/2010 17:15, Michael Bayer wrote:

RE: [sqlalchemy] update a relation from its id

2010-09-02 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of chaouche yacine Sent: 02 September 2010 11:02 To: sqlalchemy googlegroups Subject: [sqlalchemy] update a relation from its id Hello group, Suppose A has a ManyToOne relation

RE: [sqlalchemy] Re: Python's reserved keywords as column names

2010-09-10 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Andrey Semyonov Sent: 10 September 2010 14:35 To: sqlalchemy Subject: [sqlalchemy] Re: Python's reserved keywords as column names On 10 сен, 17:15, King Simon-NFHD78 simon.k

RE: [sqlalchemy] Simple Join failing

2010-10-05 Thread King Simon-NFHD78
Warwick Prince wrote: Hi All I have what I hope is a very simple question; Just started experimenting with joins, so I tried a very basic test and got a fail that I don't understand. It appears that SA is creating bad SQL, but I'm sure it's something I'm missing.. Here's what I did;

RE: [sqlalchemy] Simple Join failing

2010-10-05 Thread King Simon-NFHD78
Warwick Prince wrote: Hi Simon Thanks for that - I knew it was something wrong with the approach but simply could not pick it!Back to the test bench for another go :-) Cheers Warwick P.S. OK - I have to ask - when and how (why?) do I do the .join on the query? ;-) In SQL,

RE: [sqlalchemy] In-memory object duplication

2011-03-15 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of jln Sent: 15 March 2011 16:37 To: sqlalchemy Subject: [sqlalchemy] In-memory object duplication [SNIP] statuses = OneToMany('DocumentStatus', inverse='doc', cascade='all,

RE: [sqlalchemy] trouble with metaclass

2011-03-17 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of farcat Sent: 16 March 2011 21:01 To: sqlalchemy Subject: [sqlalchemy] trouble with metaclass I have an error i cant figure out (likely a beginners error):

RE: [sqlalchemy] In-memory object duplication

2011-03-17 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of Jacques Naude Sent: 17 March 2011 12:32 To: sqlalchemy@googlegroups.com Subject: Re: [sqlalchemy] In-memory object duplication Hi, Simon Thanks for the quick response.

RE: [sqlalchemy] Re: sqlalchemy.exc.NoReferencedTableError: Could not find table with which to generate a foreign key

2011-03-30 Thread King Simon-NFHD78
This is just the way Python works - code inside a module is only executed when that module is imported. If you don't import myapp.models.notes, then the class definitions never get executed. One solution is to import all the sub-modules in your bootstrap.py before calling create_all. Another is

RE: [sqlalchemy] Re: sqlalchemy.exc.NoReferencedTableError: Could not find table with which to generate a foreign key

2011-03-30 Thread King Simon-NFHD78
of an application works without having to import all the modules in, say, myapp.models.__init__.py Suggestions are welcome, though i'm considering the question answered Thanks alot and Regards, On Mar 30, 4:39 pm, King Simon-NFHD78 simon.k...@motorolasolutions.com wrote: This is just the way Python works

RE: [sqlalchemy] Two Objects, One Table and the inverse

2011-04-05 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of Michael Bayer Sent: 05 April 2011 18:38 To: sqlalchemy@googlegroups.com Subject: Re: [sqlalchemy] Two Objects, One Table and the inverse On Apr 5, 2011, at 12:30 PM, Israel Ben

RE: [sqlalchemy] Create a one-to-many relationship using association object with two foreign key primary keys

2011-04-14 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of frankentux Sent: 14 April 2011 14:42 To: sqlalchemy Subject: [sqlalchemy] Create a one-to-many relationship using association object with two foreign key primary keys I have

RE: [sqlalchemy] Re: Context based execution

2011-04-15 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of bool Sent: 15 April 2011 14:41 To: sqlalchemy Subject: [sqlalchemy] Re: Context based execution Hi, Thanks a lot. Can someone answer this question also

RE: [sqlalchemy] API that allows me to do additional database operations just before insert execution for SQL Expression

2011-04-19 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of bool Sent: 19 April 2011 14:16 To: sqlalchemy Subject: [sqlalchemy] API that allows me to do additional database operations just before insert execution for SQL Expression Is

RE: [sqlalchemy] Best design for commits?

2011-04-20 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of Aviv Giladi Sent: 20 April 2011 15:53 To: sqlalchemy Subject: [sqlalchemy] Best design for commits? Hey guys, I have a Pylons back-end running on SQLAlchemy. I have a script

RE: [sqlalchemy] Appending a where clause to a query

2011-04-27 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of Luka Novsak Sent: 27 April 2011 05:32 To: sqlalchemy Subject: [sqlalchemy] Appending a where clause to a query The docs on Select's where() method say: return a new select()

RE: [sqlalchemy] Re: Trying to query a relationship of a relationship

2011-06-09 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of Jules Stevenson Sent: 09 June 2011 08:53 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re: Trying to query a relationship of a relationship Sorry, for the spamming, code

RE: [sqlalchemy] Filtered backref

2011-06-09 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of Joril Sent: 08 June 2011 22:41 To: sqlalchemy Subject: [sqlalchemy] Filtered backref Hi everyone! Is it possible to have a many-to-one declarative relation between two classes

RE: [sqlalchemy] question re using the session object

2011-06-14 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of robert rottermann Sent: 14 June 2011 10:53 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] question re using the session object hi there, for a zope website I am using

RE: [sqlalchemy] General questions of a newbee

2011-06-15 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of Knack Sent: 14 June 2011 18:43 To: sqlalchemy Subject: [sqlalchemy] General questions of a newbee Hi guys, I've done some programming, but I'm new to RDBMS and ORMs. I've read

RE: [sqlalchemy] db name from session?

2011-06-15 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of Chris Withers Sent: 15 June 2011 10:48 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] db name from session? Hi All, If I have a session object, what's the correct way

RE: [sqlalchemy] Accessing several databases

2011-06-16 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of Julian J. M. Sent: 16 June 2011 11:43 To: sqlalchemy Subject: [sqlalchemy] Accessing several databases Hello, I'm intending to use sqalchemy with orm for loading and storing

RE: [sqlalchemy] mapping a class linked with two other classes (AttributeError: 'str' object has no attribute '_sa_instance_state')

2011-06-16 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of Jules Stevenson Sent: 16 June 2011 08:44 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] mapping a class linked with two other classes (AttributeError: 'str' object has no

RE: [sqlalchemy] dynamically set table_name at runtime

2011-06-21 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of Cody Django Sent: 20 June 2011 19:37 To: sqlalchemy Subject: [sqlalchemy] dynamically set table_name at runtime Hello! I would like to dynamically set/change the table that is

RE: [sqlalchemy] (OperationalError) (1066, Not unique table/alias: '...') when selecting only from a joined table

2011-06-28 Thread King Simon-NFHD78
Michael Bayer wrote: - I am loathe to reference the 0.5 docs as people keep finding them and thinking they are current, but an example of this is at http://www.sqlalchemy.org/docs/05/ormtutorial.html#querying-with- joins (Note to people reading this: these are the *OLD DOCS* regarding 0.5;

RE: [sqlalchemy] In case of joinedload_all how do I order by on a columns of those relations

2011-06-29 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of Marc Van Olmen Sent: 29 June 2011 04:19 To: sqlalchemy Subject: [sqlalchemy] In case of joinedload_all how do I order by on a columns of those relations Hi I'm trying to

RE: [sqlalchemy] relationship problem

2011-07-12 Thread King Simon-NFHD78
mik wrote: Hello, I am trying to use sqlalchemy with oracle, here is my code: from sqlalchemy import * from sqlalchemy.orm import sessionmaker, mapper, relationship class Activite(object): pass class Famprod(object): pass engine = create_engine('oracle://login/paswd@db',

RE: [sqlalchemy] information about filed create_engine

2011-07-13 Thread King Simon-NFHD78
Eduardo wrote Hi, I am trying to prompt an answer from a database after failed create_engine command. I searched through the source code and I found TypeError, and ValueError returns but they relate (if I understood well only to the access parameters). My problem is that I am sure that my

RE: [sqlalchemy] Re: information about filed create_engine

2011-07-14 Thread King Simon-NFHD78
Eduardo wrote On Jul 13, 7:11 pm, King Simon-NFHD78 simon.k...@motorolasolutions.com wrote: Eduardo wrote Hi, I am trying to prompt an answer from a database after failed create_engine command. I searched through the source code and I found TypeError, and ValueError returns

RE: [sqlalchemy] Re: information about filed create_engine

2011-07-14 Thread King Simon-NFHD78
Eduardo wrote When I use the same script with a standalone application it works but when I try to run it as a wsgi application it fails (wsgi logs does not contain any information regarding the failure!) Try turning on SQL logging (either by passing echo='debug') to create_engine, or by

RE: [sqlalchemy] Re: information about filed create_engine

2011-07-14 Thread King Simon-NFHD78
Eduardo wrote When I use the same script with a standalone application it works but when I try to run it as a wsgi application it fails (wsgi logs does not contain any information regarding the failure!) Try turning on SQL logging (either by passing echo='debug') to create_engine, or by

RE: [sqlalchemy] Re: information about filed create_engine

2011-07-14 Thread King Simon-NFHD78
Eduardo wrote: On Jul 14, 10:49 am, King Simon-NFHD78 simon.k...@motorolasolutions.com wrote: Eduardo wrote When I use the same script with a standalone application it works but when I try to run it as a wsgi application it fails (wsgi logs does not contain any information

RE: [sqlalchemy] Re: information about filed create_engine

2011-07-18 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of Eduardo Sent: 18 July 2011 14:12 To: sqlalchemy Subject: [sqlalchemy] Re: information about filed create_engine I dont get any log. The access strings from the local and wsgi

RE: [sqlalchemy] Re: information about filed create_engine

2011-07-18 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of Eduardo Sent: 18 July 2011 15:54 To: sqlalchemy Subject: [sqlalchemy] Re: information about filed create_engine Yes, I use wsgi server of the python library bottle and I don't

RE: [sqlalchemy] Re: information about filed create_engine

2011-07-19 Thread King Simon-NFHD78
Eduardo wrote: /.../.../python2.6/site-packages/SQLAlchemy-0.6.5- py2.6.egg/sqlalchemy/ dialects/postgresql/psycopg2.py, line 234, in dbapi psycopg = __import__('psycopg2') ImportError: No module named psycopg2 The module psycopg2 is already installed in the site-packages directory. I

RE: [sqlalchemy] Question about sqlalchemy inserts and deletes order in a transaction

2011-07-19 Thread King Simon-NFHD78
ammar azif wrote: Hi, The code that I am working on deletes rows from table A that are based on a certain query and then recreates these rows based on entries supplied by a csv file. Table A is referenced by table B. My question is, how does sql alchemy manage inserts and deletes in a

RE: [sqlalchemy] how to get last record from a resultset

2011-07-20 Thread King Simon-NFHD78
If you don't have something consistent to sort by, then I'm not sure that the last record is meaningful, is it? If you have 10 rows with the same voucher code and account code (and there is nothing else to uniquely identify them, such as a more precise timestamp, or an auto-incrementing ID),

RE: [sqlalchemy] Updating records in table not working

2011-07-27 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of jos.carpente...@yahoo.com Sent: 26 July 2011 18:27 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Updating records in table not working I'm using Postgres as a database.

RE: RE: [sqlalchemy] Updating records in table not working

2011-07-27 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of Gunnlaugur Briem Sent: 27 July 2011 10:36 To: sqlalchemy@googlegroups.com Subject: Re: RE: [sqlalchemy] Updating records in table not working On Wednesday, 27 July 2011 08:23:14

RE: [sqlalchemy] engine.echo not working as expected

2011-07-27 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of Mike Conley Sent: 27 July 2011 17:43 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] engine.echo not working as expected Under 0.5 I was able to turn echo on and off as

RE: [sqlalchemy] update existing row

2011-08-01 Thread King Simon-NFHD78
vitsin wrote: hi, can't figure out why raw SQL works fine, but update() is not working: 1.working raw SQL: self.session.execute(update public.my_table set status='L',updated_at=now() where my_name='%s' % (self.my_name)) 2.non working update() from Alchemy: s = aliased(MyTable) query =

RE: [sqlalchemy] data driven schema in sqlalchemy

2011-08-05 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of espresso maker Sent: 05 August 2011 06:19 To: sqlalchemy Subject: [sqlalchemy] data driven schema in sqlalchemy Hi there, I have a data driven database schema that I am trying

RE: [sqlalchemy] Re: Error while using CAST

2011-09-14 Thread King Simon-NFHD78
Does this work instead: table.update().values(empno = cast(table.c.empno,Integer)).execute() ie. a bare 'empno' inside your cast expression is just referring to a python variable 'empno', which you've probably set to the value 'testing' at some other point in your code. You need the column

RE: [sqlalchemy] Bulk creation of columns

2011-09-22 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of pravin battula Sent: 21 September 2011 12:54 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Bulk creation of columns Hi, How can i create columns in bulk using

[sqlalchemy] Possible bug with subqueryload

2011-09-27 Thread King Simon-NFHD78
Hi, I think there may be a bug in the interaction between 'subqueryload' and having a default 'order_by' defined on a mapped class. When the subquery is run, it looks like the ORDER BY is being placed on the outer query, whereas it should be on the inner query. The full test case is below, but

RE: [sqlalchemy] Possible bug with subqueryload

2011-09-27 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of Michael Bayer Sent: 27 September 2011 16:24 To: sqlalchemy@googlegroups.com Subject: Re: [sqlalchemy] Possible bug with subqueryload Hi Simon - yeah that looks pretty buglike

RE: [sqlalchemy] Possible bug with subqueryload

2011-09-28 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of Michael Bayer Sent: 27 September 2011 19:37 To: sqlalchemy@googlegroups.com Subject: Re: [sqlalchemy] Possible bug with subqueryload On Sep 27, 2011, at 1:16 PM, King Simon

[sqlalchemy] Re: the return type of conn.execute(text())

2009-01-28 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Faheem Mitha Sent: 27 January 2009 22:41 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] the return type of conn.execute(text()) Hi, Today I attempted to serialize

[sqlalchemy] Re: Using orderedlist with a secondary table

2009-01-30 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Nathan Harmston Sent: 30 January 2009 13:15 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Using orderedlist with a secondary table Hi, I am currently trying to make

[sqlalchemy] Re: polymorphic_identity not allowed to be zero for base class?

2009-01-30 Thread King Simon-NFHD78
Would None (ie. SQL NULL) be a valid polymorphic identity? -Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Michael Bayer Sent: 30 January 2009 17:06 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re:

[sqlalchemy] Re: polymorphic_identity not allowed to be zero for base class?

2009-01-30 Thread King Simon-NFHD78
, 2009, at 12:19 PM, King Simon-NFHD78 wrote: Would None (ie. SQL NULL) be a valid polymorphic identity? it becomes that issue where we just need some kind of constant to represent THIS_IS_NOT_DEFINED, so that we know when polymorphic_identity is defined or not. it's

[sqlalchemy] Re: classes in separate files

2009-02-09 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of camlost Sent: 09 February 2009 09:18 To: sqlalchemy Subject: [sqlalchemy] classes in separate files Hi, could someone advice me, please, how to split classes into individual

[sqlalchemy] Re: altering tables

2009-02-11 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of mhearne808[insert-at-sign-here]gmail[insert-dot-here]com Sent: 10 February 2009 19:13 To: sqlalchemy Subject: [sqlalchemy] altering tables [snip] I'd like to update the

[sqlalchemy] Re: Separating session and db/models definitions

2009-02-25 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of bsdemon Sent: 24 February 2009 20:22 To: sqlalchemy Subject: [sqlalchemy] Separating session and db/models definitions Hello. I have the following states of things: 1) I

[sqlalchemy] Re: Creating SQL Expression

2009-02-25 Thread King Simon-NFHD78
Could you use the python 'operator' module (http://docs.python.org/library/operator.html)? Eg. (untested): import operator operations = { '+': operator.add, '-': operator.sub, # etc. } def combine_columns(op, *cols): return operations[op](*cols) sum_column =

[sqlalchemy] Re: Class.query vs DBSession.query(Class)

2009-02-27 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Sanjay Sent: 27 February 2009 05:52 To: sqlalchemy Subject: [sqlalchemy] Class.query vs DBSession.query(Class) Hi, There are two styles of writing code for querying: the

[sqlalchemy] Re: Insertion issues

2009-04-03 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Tanmoy Sent: 03 April 2009 14:30 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re: Insertion issues import sqlalchemy from sqlalchemy import * engine =

[sqlalchemy] Re: mapping class against arbitrary SQL expression

2009-04-17 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of JanW Sent: 17 April 2009 13:18 To: sqlalchemy Subject: [sqlalchemy] mapping class against arbitrary SQL expression Hi, is there a way to map a class against an arbitrary

[sqlalchemy] Re: mapping class against arbitrary SQL expression

2009-04-17 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of JanW Sent: 17 April 2009 14:45 To: sqlalchemy Subject: [sqlalchemy] Re: mapping class against arbitrary SQL expression OK, thanks, it does work if you make an alias on

[sqlalchemy] Re: This join does not fill in the collection

2009-05-28 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Marcin Krol Sent: 28 May 2009 10:09 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] This join does not fill in the collection Hello everyone,

[sqlalchemy] Re: This join does not fill in the collection

2009-05-28 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Marcin Krol Sent: 28 May 2009 13:57 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re: This join does not fill in the collection Hello Simon, This answered my

[sqlalchemy] Re: Query - column names

2009-06-04 Thread King Simon-NFHD78
George Sakkis wrote: Is there a (public) API for getting the column names of a given Query instance and other similar introspection needs ? I didn't find anything related in the docs but after digging in the code I came up with col_names = [e._result_label for e in q._entities] but

[sqlalchemy] Re: aggregation with count and webhelpers.paginate

2009-06-22 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Hollister Sent: 20 June 2009 02:15 To: sqlalchemy Subject: [sqlalchemy] Re: aggregation with count and webhelpers.paginate Well, that worked great: q =

[sqlalchemy] Re: Dynamic making of the where clause

2009-06-26 Thread King Simon-NFHD78
On Jun 23, 3:32 pm, Ash ashishsinghbha...@gmail.com wrote: Hello, I am tryin to make the dynamic where clause using append_whereclause. But how i can do that,  For eg : I have a==b and c in (1,2,3,4) or d like %s So i made three sqlalchemy expression 1. a==b 2. c in

[sqlalchemy] Re: autoload of db view treating columns as Decimal

2009-07-23 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Randy Syring Sent: 23 July 2009 07:23 To: sqlalchemy Subject: [sqlalchemy] Re: autoload of db view treating columns as Decimal Well, I am not really sure what the problem

[sqlalchemy] Re: Session mapper and Class.query() method

2009-07-27 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of naktinis Sent: 27 July 2009 13:07 To: sqlalchemy Subject: [sqlalchemy] Session mapper and Class.query() method I've seen that Session.mapper is deprecated. While I agree that

[sqlalchemy] Backrefs and the identity map

2009-08-03 Thread King Simon-NFHD78
Hi, Does accessing a backref always have to issue SQL, even if the object to be loaded already exists in the identity map? For example, if I have a many-to-one lazy-loaded relationship from Master to Detail with a backref, the statement master.details[0].master will issue SQL for the '.master'

[sqlalchemy] Re: Backrefs and the identity map

2009-08-03 Thread King Simon-NFHD78
I wrote: Hi, Does accessing a backref always have to issue SQL, even if the object to be loaded already exists in the identity map? For example, if I have a many-to-one lazy-loaded relationship from Master to Detail with a backref, the statement master.details[0].master will issue SQL

[sqlalchemy] Re: Backrefs and the identity map

2009-08-03 Thread King Simon-NFHD78
Michael Bayer wrote: King Simon-NFHD78 wrote: to master_id = sa.Column(sa.Integer, sa.ForeignKey(Master.__table__.c.id)) ...and now it seems to work! So is this a bug? yes, that would be a bug. There are some other scenarios where this kind of thing occurs (lazy clause

[sqlalchemy] Re: new questions

2009-08-17 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of darkblueB Sent: 17 August 2009 06:31 To: sqlalchemy Subject: [sqlalchemy] new questions Hi- I have just read a lot and gone through some exercises, but am at an early

[sqlalchemy] Re: renaming columns

2009-08-17 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Michele Simionato Sent: 17 August 2009 16:11 To: sqlalchemy Subject: [sqlalchemy] renaming columns There should be an easy way to do this, but I cannot find it in the

[sqlalchemy] Re: new questions

2009-08-19 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of darkblueB Sent: 19 August 2009 02:58 To: sqlalchemy Subject: [sqlalchemy] Re: new questions Hi Simon thanks for the reply.. Your second part is straightforward.. The first

[sqlalchemy] Re: table creation oddity

2009-08-21 Thread King Simon-NFHD78
Faheem Mitha wrote: Hi, The following script is then followed by its output, and finally by the table output. I don't get what is going on here. Yes, I should commit the session, and the table is empty as expected, but why does the id keep incrementing on successive runs, and

[sqlalchemy] Re: index in SA

2009-08-21 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of rajasekhar911 Sent: 21 August 2009 10:25 To: sqlalchemy Subject: [sqlalchemy] Re: index in SA i tried class MyClass: __tablename__ = 'my_table' id =

[sqlalchemy] Re: table creation oddity

2009-08-21 Thread King Simon-NFHD78
Faheem Mitha wrote: Thanks for the fast and helpful response. This looks like an artifact of how I am creating the table. I wonder if this would still show up if I explicitly specified the id. I could check this. Also, presumably if I had other cols in the table, they wouldn't show up in

[sqlalchemy] Re: negative indexes in query slices?

2009-08-24 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of john smallberries Sent: 24 August 2009 08:51 To: sqlalchemy Subject: [sqlalchemy] negative indexes in query slices? I just tried limiting a query to the final 10 items of a

[sqlalchemy] Re: ForeignKey on a ForeignKey

2009-08-24 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Laurent Rahuel Sent: 24 August 2009 12:16 To: sqlalchemy Subject: [sqlalchemy] ForeignKey on a ForeignKey Hi all, I'm stucked with a problem I'm not able to solve (SA

  1   2   3   >