[sqlalchemy] Re: Declarative with Enthoughts Traits framework.

2009-03-22 Thread az
good on yer! one thing that i sorta failed is making a clean set of tests for this. if u aren't too far in the usage, save some major future headaches and do yourself a favour, make such test set. All the things u've tried has to be (simple) testcases - it will be the _spec_ of how the thing

[sqlalchemy] Using cast with column_property

2009-03-22 Thread Shawn Church
I'm trying to define a column_property including a cast expression, but am running into the following error: import sqlalchemy sqlalchemy.__version__ '0.5.2' from sqlalchemy import * from sqlalchemy.orm import relation, column_property, sessionmaker from

[sqlalchemy] Re: Using cast with column_property

2009-03-22 Thread Shawn Church
On Sun, Mar 22, 2009 at 8:17 AM, Michael Bayer mike...@zzzcomputing.comwrote: theres three layers to this issue. the first is, yes as_scalar() is trying to compile the expression which I don't think there's a very good reason, so ill likely commit a change for that (it will result in a

[sqlalchemy] Re: Declarative with Enthoughts Traits framework.

2009-03-22 Thread Christiaan Putter
Hi Svilen, Setting up tests is a very good idea, I'll start on some unit testing immediately. Definitely the best way to insure behaviour remains constant as you're working on the implementation, was just to lazy to do so up till now. Speaking of laziness, I've noticed that setting lazy=False

[sqlalchemy] Re: Using cast with column_property

2009-03-22 Thread Shawn Church
Could cast be defined to allow string values (i.e. cast(..., Numeric(14,2))? This would fix my problem. Guess I will check the code and see. On Sun, Mar 22, 2009 at 12:00 PM, Shawn Church sh...@schurchcomputers.comwrote: On Sun, Mar 22, 2009 at 8:17 AM, Michael Bayer

[sqlalchemy] Re: Using cast with column_property

2009-03-22 Thread Michael Bayer
On Mar 22, 2009, at 3:00 PM, Shawn Church wrote: This isn't really the same thing because the float would be rounded after the sum not line by line. I think I could also use sum(... type_ = Numeric(14,2)) for the same result. Am I missing an easier way to do this? its an SQLA bug

[sqlalchemy] Re: Using cast with column_property

2009-03-22 Thread Shawn Church
On Sun, Mar 22, 2009 at 12:39 PM, Michael Bayer mike...@zzzcomputing.comwrote: On Mar 22, 2009, at 3:00 PM, Shawn Church wrote: This isn't really the same thing because the float would be rounded after the sum not line by line. I think I could also use sum(... type_ = Numeric(14,2))

[sqlalchemy] Re: Declarative with Enthoughts Traits framework.

2009-03-22 Thread az
On Sunday 22 March 2009 21:17:15 Christiaan Putter wrote: Hi Svilen, Setting up tests is a very good idea, I'll start on some unit testing immediately. Definitely the best way to insure behaviour remains constant as you're working on the implementation, was just to lazy to do so up till

[sqlalchemy] Re: Declarative with Enthoughts Traits framework.

2009-03-22 Thread Christiaan Putter
Oh yeah, before I forget... Regarding the object expiration: The behaviour as it is now in SA is fine I guess, seeing as the purpose of having an ORM is having instances reflect their status in the database at all times. No session means no database and so the behaviour is going to be strange.

[sqlalchemy] Re: Declarative with Enthoughts Traits framework.

2009-03-22 Thread Christiaan Putter
Hi, Maybe some better explanation is required from my side for you to be able to help me better. My app is basically for doing some plotting, analysis and filtering of securities on the stock market. The main class that does most of the work is Security(HasTraitsORM), where HasTraitsORM is my