[sqlalchemy] Re: Polymorphic mappers on boolean types

2008-01-06 Thread Dave Harrison
might have made that change right in 0.4.2 thinking, nobody would use a boolean False as a discriminatorany chance you can go with some plain int or string for that ? On Jan 5, 2008, at 11:47 PM, Dave Harrison wrote: Hey all, More fun with inheritance and mappers. In the following

[sqlalchemy] Re: Emptying out the session of new objects

2008-01-05 Thread Dave Harrison
On Sunday 06 January 2008 05:30:04 Michael Bayer wrote: On Jan 4, 2008, at 9:46 PM, Dave Harrison wrote: Hey Mike, Below is a minimal test case that always produces the below failure for me under 0.4.2 but not under 0.4.1, OK, its actually something that was buggy in 0.4.1 but didnt

[sqlalchemy] Polymorphic mappers on boolean types

2008-01-05 Thread Dave Harrison
Hey all, More fun with inheritance and mappers. In the following situation where the polymorphic type is a Boolean, the mapper for the object that matches on False incorrectly returns the parent object. Cheers Dave -- -- testapi.py

[sqlalchemy] Emptying out the session of new objects

2008-01-04 Thread Dave Harrison
Hey all, I'm unit testing my DB api's, and I've found that if I don't explicitly expunge my objects from the session at the end of each test, I get objects left over in the session when the next test runs. Is there an easy way of flushing all objects that are categorised as new in the session

[sqlalchemy] Re: Emptying out the session of new objects

2008-01-04 Thread Dave Harrison
On Friday 04 January 2008 23:32:21 Alexandre da Silva wrote: Is there an easy way of flushing all objects that are categorised as new in the session ?? I think you can use session.clear(), it will remove objects from session, and persistent objects will stay on database. Att Alexandre

[sqlalchemy] Re: Emptying out the session of new objects

2008-01-04 Thread Dave Harrison
On Saturday 05 January 2008 03:08:54 Michael Bayer wrote: On Jan 4, 2008, at 7:44 AM, Dave Harrison wrote: On Friday 04 January 2008 23:32:21 Alexandre da Silva wrote: Is there an easy way of flushing all objects that are categorised as new in the session ?? I think you can use

[sqlalchemy] Mapper inheritance and joins

2007-12-29 Thread Dave Harrison
Hi all, I've got a situation where I want to use inherited mappers, with joins to other inherited mappers. However I'm getting some weird results where the following query should show no cat objects, instead I get 2 back for both queries. Can anyone spot the flaw in my code here ? The api and

[sqlalchemy] Mapper properties and a callback

2007-12-21 Thread Dave Harrison
Hi all, I have a situation where I want to declare a relation between two tables, but I want to be able to run a callback whenever I append to that relation. Here's an example class Kennel: def callback(self, o): print callback, o mapper = Mapper( Kennel, kennelTable,

[sqlalchemy] Deprecation error raised for query on singly inherited table query ?

2007-11-10 Thread Dave Harrison
Hi all, The following is a stripped down use case that I have, where I use single table inheritance and run a query.first(), however I get a deprecation warning and I was wondering why ?? Cheers Dave % cat db.py from sqlalchemy import * from sqlalchemy.orm import * session =

[sqlalchemy] 'Column' object has no attribute 'tables'

2007-08-02 Thread Dave Harrison
Hi all, I'm just working on upgrading my db code to use the new 0.4 api, and I've hit a problem Based on the following table def (there's lots more in there, but I've commented everything out but this table and am still getting the same error), sysMessageTable = Table( 'sysmessage',