[sqlalchemy] Re: object_session(remote_device_object) returns noneType

2008-10-13 Thread Heston James - Cold Beans
Michael, Thanks for confirming that, seems it was a strong reference to the session which was a local function variable, if was being destroyed and unreferencing my object. I'll look at ways to combat that ;-) Cheers, Heston From: sqlalchemy@googlegroups.com [mailto:[EMAIL

[sqlalchemy] Re: in_( bindparam(list) ) ?

2008-10-13 Thread Michael Bayer
On Oct 13, 2008, at 6:41 AM, [EMAIL PROTECTED] wrote: why i cannot give in_() a bindparam? q.filter( x.in_( somelistorset )) works q.filter( x.in_( bindparam('somename') )) fails ... File sqlalchemy/sql/expression.py, line 1368, in _in_impl for o in seq_or_selectable: TypeError:

[sqlalchemy] connect data base

2008-10-13 Thread nano
hello, I'm new to sqlalchemy and database I just installed postgres http://doc.fedora-fr.org/wiki/ Installation_et_configuration_de_PostgreSQL, and I have a problem connecting to my database with a script sqlalchemy the error is File/usr/lib/python2.4/site-packages/SQLAlchemy-0.4.0-

[sqlalchemy] Re: in_( bindparam(list) ) ?

2008-10-13 Thread Wayne Witzel
On Oct 13, 6:41 am, [EMAIL PROTECTED] wrote: why i cannot give in_() a bindparam?    q.filter( x.in_( somelistorset )) works q.filter( x.in_( bindparam('somename') )) fails ... File sqlalchemy/sql/expression.py, line 1368, in _in_impl     for o in seq_or_selectable: TypeError:

[sqlalchemy] Re: in_( bindparam(list) ) ?

2008-10-13 Thread Wayne Witzel
On Oct 13, 10:21 am, Michael Bayer [EMAIL PROTECTED] wrote: On Oct 13, 2008, at 6:41 AM, [EMAIL PROTECTED] wrote: why i cannot give in_() a bindparam? q.filter( x.in_( somelistorset )) works q.filter( x.in_( bindparam('somename') )) fails ... File sqlalchemy/sql/expression.py,

[sqlalchemy] Re: connect data base

2008-10-13 Thread Werner F. Bruhin
nano wrote: hello, I'm new to sqlalchemy and database I just installed postgres http://doc.fedora-fr.org/wiki/ Installation_et_configuration_de_PostgreSQL, and I have a problem connecting to my database with a script sqlalchemy the error is

[sqlalchemy] Re: in_( bindparam(list) ) ?

2008-10-13 Thread az
On Monday 13 October 2008 17:21:31 Michael Bayer wrote: On Oct 13, 2008, at 6:41 AM, [EMAIL PROTECTED] wrote: why i cannot give in_() a bindparam? q.filter( x.in_( somelistorset )) works q.filter( x.in_( bindparam('somename') )) fails ... File sqlalchemy/sql/expression.py, line 1368,

[sqlalchemy] Passing a param that is a list to execute()

2008-10-13 Thread Jonathan Marshall
Hi, I'm not sure whether this is a bug in sqlalchemy or user error. I'm having trouble passing a parameter to execute() that is a list of values for the in operator. E.g.: session.execute(sql.text('SELECT * from users where x in :xs'), params={'xs' : some_seq}) This works fine when using

[sqlalchemy] similar to composite()

2008-10-13 Thread g00fy
I have my table Warehouse collumns like: id, owner_id , area_total, area_office ... ,area_storage I would like to have acces to all areas by Warehouse.area.property: example: Warehouse.area.storage I did composite(), but now I can't filter like: filter(Warehouse.area.total =100) and even

[sqlalchemy] Re: in_( bindparam(list) ) ?

2008-10-13 Thread jason kirtland
Michael Bayer wrote: On Oct 13, 2008, at 10:58 AM, [EMAIL PROTECTED] wrote: On Monday 13 October 2008 17:21:31 Michael Bayer wrote: On Oct 13, 2008, at 6:41 AM, [EMAIL PROTECTED] wrote: why i cannot give in_() a bindparam? q.filter( x.in_( somelistorset )) works q.filter( x.in_(

[sqlalchemy] Re: similar to composite()

2008-10-13 Thread Michael Bayer
On Oct 13, 2008, at 11:14 AM, g00fy wrote: I have my table Warehouse collumns like: id, owner_id , area_total, area_office ... ,area_storage I would like to have acces to all areas by Warehouse.area.property: example: Warehouse.area.storage I did composite(), but now I can't filter

[sqlalchemy] 0.4: can not append objects to instrumentedlists

2008-10-13 Thread _tyr_
I use entity_name's for all mappers. So I dont have mappers with entity_name = None. With sqlalchemy 0.4 I run into errors if I try to add objects to InstrumentedList's: (Pdb) len( self.users ) 1 (Pdb) self.users [common.User object at 0x1d1992a8] (Pdb) type( self.users ) class

[sqlalchemy] Re: 0.4: can not append objects to instrumentedlists

2008-10-13 Thread Michael Bayer
the entity_name feature is somewhat broken in 0.4 and has been removed entirely in 0.5 - there's too much ambiguity in its usage (namely, the attributes/behavior of a class cannot be determined until the class is associated with a specific mapper via the session). Its possible that this

[sqlalchemy] Re: connect data base

2008-10-13 Thread Kyle Schaffrick
On Mon, 13 Oct 2008 01:53:13 -0700 (PDT) nano [EMAIL PROTECTED] wrote: hello, I'm new to sqlalchemy and database I just installed postgres http://doc.fedora-fr.org/wiki/ Installation_et_configuration_de_PostgreSQL, and I have a problem connecting to my database with a script sqlalchemy

[sqlalchemy] Re: in_( bindparam(list) ) ?

2008-10-13 Thread Michael Bayer
On Oct 13, 2008, at 10:58 AM, [EMAIL PROTECTED] wrote: On Monday 13 October 2008 17:21:31 Michael Bayer wrote: On Oct 13, 2008, at 6:41 AM, [EMAIL PROTECTED] wrote: why i cannot give in_() a bindparam? q.filter( x.in_( somelistorset )) works q.filter( x.in_( bindparam('somename') ))

[sqlalchemy] in_( bindparam(list) ) ?

2008-10-13 Thread az
why i cannot give in_() a bindparam?   q.filter( x.in_( somelistorset )) works q.filter( x.in_( bindparam('somename') )) fails ... File sqlalchemy/sql/expression.py, line 1368, in _in_impl     for o in seq_or_selectable: TypeError: '_BindParamClause' object is not iterable is this possible or

[sqlalchemy] Aw: [sqlalchemy] Re: 0.4: can not append objects to instrumentedlists

2008-10-13 Thread _tyr_
What is preventing you from simply mapping different classes ? Different Customers uses different (her own) table spaces. So we must map a Class to different tables. You remove entity_name, but how you specify the 'user dependent storage' in sqlalchem 0.5? This behavior is a typical

[sqlalchemy] Re: Aw: [sqlalchemy] Re: 0.4: can not append objects to instrumentedlists

2008-10-13 Thread jason kirtland
[EMAIL PROTECTED] wrote: I spent some time to migrate to sqlalchemy 0.4 and it's to late to go back to 0.3. What can I do to add objects to properties (InstumentedLists) in sqlalchemy 0.4 (with different mappers)? I suspect that case will work if you add the user to the session under the

[sqlalchemy] Re: reflection unavailable for mysql temporary tables?

2008-10-13 Thread Andy Davidoff
On Oct 11, 1:29 pm, Michael Bayer [EMAIL PROTECTED] wrote: On Oct 11, 2008, at 12:49 PM, AndyDavidoffwrote: This fixes the first part of this problem, but unfortunately the `show create table` is performed in the connection, not the session in which the temporary table was created.  MySQL

[sqlalchemy] Re: Passing a param that is a list to execute()

2008-10-13 Thread Michael Bayer
On Oct 13, 2008, at 11:13 AM, Jonathan Marshall wrote: Hi, I'm not sure whether this is a bug in sqlalchemy or user error. I'm having trouble passing a parameter to execute() that is a list of values for the in operator. E.g.: session.execute(sql.text('SELECT * from users where x in

[sqlalchemy] Re: reflection unavailable for mysql temporary tables?

2008-10-13 Thread jason kirtland
Andy Davidoff wrote: On Oct 11, 1:29 pm, Michael Bayer [EMAIL PROTECTED] wrote: On Oct 11, 2008, at 12:49 PM, AndyDavidoffwrote: This fixes the first part of this problem, but unfortunately the `show create table` is performed in the connection, not the session in which the temporary table

[sqlalchemy] Re: similar to composite()

2008-10-13 Thread az
see a thread composites started by me on 21.08.2008 - i have something named composer for such embedded structures but i have not yet moved further into how to make that one a Comparable in terms of query.filter(). u can try do it... On Monday 13 October 2008 18:14:42 g00fy wrote: I have my

[sqlalchemy] Re: Aw: [sqlalchemy] Re: 0.4: can not append objects to instrumentedlists

2008-10-13 Thread Michael Bayer
On Oct 13, 2008, at 12:22 PM, [EMAIL PROTECTED] wrote: What is preventing you from simply mapping different classes ? Different Customers uses different (her own) table spaces. So we must map a Class to different tables. You remove entity_name, but how you specify the 'user dependent

[sqlalchemy] Re: reflection unavailable for mysql temporary tables?

2008-10-13 Thread Michael Bayer
On Oct 13, 2008, at 12:29 PM, Andy Davidoff wrote: On Oct 11, 1:29 pm, Michael Bayer [EMAIL PROTECTED] wrote: On Oct 11, 2008, at 12:49 PM, AndyDavidoffwrote: This fixes the first part of this problem, but unfortunately the `show create table` is performed in the connection, not the

[sqlalchemy] Re: similar to composite()

2008-10-13 Thread g00fy
How this Proxy object is going to work exacly? Will that generate extra Sql or what? I assume that I should just change __getattr__() to desired and return Warehouse.key ? or warehouse_table.c.key? On 13 Paź, 17:25, Michael Bayer [EMAIL PROTECTED] wrote: On Oct 13, 2008, at 11:14 AM, g00fy

[sqlalchemy] How to pass null values

2008-10-13 Thread Mike
Hi, I am trying to transfer some data from a sqlite database to an MS SQL database. I need to be able to pass null values for some of the empty columns in the row. For example, I have something like this for my row's format: date | id | reg | ot | hol The first two fields are required, but any

[sqlalchemy] Re: How to pass null values

2008-10-13 Thread Michael Bayer
On Oct 13, 2008, at 2:59 PM, Mike wrote: Hi, I am trying to transfer some data from a sqlite database to an MS SQL database. I need to be able to pass null values for some of the empty columns in the row. For example, I have something like this for my row's format: date | id | reg | ot

[sqlalchemy] Re: similar to composite()

2008-10-13 Thread Michael Bayer
On Oct 13, 2008, at 2:50 PM, g00fy wrote: How this Proxy object is going to work exacly? Will that generate extra Sql or what? I assume that I should just change __getattr__() to desired and return Warehouse.key ? or warehouse_table.c.key? the proxy, which actually should read: class

[sqlalchemy] Aw: [sqlalchemy] Re: Aw: [sqlalchemy] Re: 0.4: can not append objects to instrumentedlists

2008-10-13 Thread _tyr_
many thanks to jason and michael! I add the objects to the current session and ... it works. Migration to 0.5 seems to be a big step (for us). We don't use fancy orm tricks. The only thing are 'user dependet table spaces'. Hence its possible your example, michael, can work for us. Thanks.