[sqlalchemy] Re: ObjectDeletedError

2010-03-20 Thread Shawn Church
10 at 6:46 PM, Shawn Church wrote: > I'm trying to refactor an existing cherypy/pyamf application and am running > into the following problem. The code: > > @RemoteClass(alias="common.model.vo.OrderVO") > class OrderVO(object): pass > > cla

[sqlalchemy] ObjectDeletedError

2010-03-19 Thread Shawn Church
I'm trying to refactor an existing cherypy/pyamf application and am running into the following problem. The code: @RemoteClass(alias="common.model.vo.OrderVO") class OrderVO(object): pass class Orders(Service): """ Query and modify model.application.Order """ klass = model.Order @s

[sqlalchemy] Re: Using cast with column_property

2009-03-24 Thread Shawn Church
e = column_property( select([O.payments - O.total]).label("change_due")) del O, L, P, N, total Thanks once again for your assistance. Shawn On Sun, Mar 22, 2009 at 1:14 PM, Shawn Church wrote: > > > On Sun, Mar 22, 2009 at 12:39 PM, Michael Bayer > wrote: > >>

[sqlalchemy] Re: Using cast with column_property

2009-03-22 Thread Shawn Church
On Sun, Mar 22, 2009 at 12:39 PM, Michael Bayer wrote: > > > 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(... >

[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 wrote: > > > On Sun, Mar 22, 2009 at 8:17 AM, Michael Bayer > wrote: > >

[sqlalchemy] Re: Using cast with column_property

2009-03-22 Thread Shawn Church
cast(select([func.sum(IF(L.taxable, L.quantity * L.price, 0))], L.order_id == id).as_scalar(), Numeric(14.2)).label("taxable")) 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 su

[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 >>> f

[sqlalchemy] Re: Suggestions on using a dialect outside of the Alchemy installation tree

2009-03-12 Thread Shawn Church
On Tue, Mar 10, 2009 at 8:52 AM, phrrn...@googlemail.com < phrrn...@googlemail.com> wrote: > > The quality of the support in this group is remarkable. The answers > are starting to remind me of Guy Harris in terms of quality and > clarity! (If the name is not familiar to you then check out the Use

[sqlalchemy] Re: Self referential declarative problem

2009-03-06 Thread Shawn Church
On Fri, Mar 6, 2009 at 4:36 PM, Michael Bayer wrote: > > uh yeah it is. the sync of the primary key to the foreign key happens > after the parent object is updated. but the child is also the parent, so > the flush completes without ever getting to the "child". if you set > post_update=True t

[sqlalchemy] Re: Self referential declarative problem

2009-03-06 Thread Shawn Church
On Fri, Mar 6, 2009 at 3:43 PM, Michael Bayer wrote: > > > On Mar 6, 2009, at 6:14 PM, Shawn Church wrote: > > > > > But setting the User.modified_by relation does not work: > > > >>>> user.modified_by = user > > the key here is that you're

[sqlalchemy] Self referential declarative problem

2009-03-06 Thread Shawn Church
I'm trying to convert some classes from Elixir to declarative and am running into a problem defining a simple self-referencing definition. I've searched the archives and have tried several things but seem to be missing something: >>> import sqlalchemy >>> sqlalchemy.__version__ '0.5.2' >>> from

[sqlalchemy] Re: Mixing ORM and sql expressions

2009-01-15 Thread Shawn Church
For performance reasons I am converting some operations from ORM to SQL Expression syntax. In other words instead of session.query(...) I'm now using select(...).execute(). This has led to a couple of questions: 1) I was relying on thread local sessions to handle all the ugly details for me whe

[sqlalchemy] Re: SQLAlchemy 0.5rc4 Released

2008-11-16 Thread Shawn Church
On Sun, Nov 16, 2008 at 1:24 AM, Werner F. Bruhin <[EMAIL PROTECTED]>wrote: > > But after I had installed rc3 I easy_installed from svn > (http://svn.sqlalchemy.org/sqlalchemy/trunk) and then when rc4 came out > and I wanted to do the upgrade I got again a dev version > (sqlalchemy-0.5.0rc4dev_r0)

[sqlalchemy] Re: SQLAlchemy 0.5rc4 Released

2008-11-15 Thread Shawn Church
On Sat, Nov 15, 2008 at 7:55 AM, Michael Bayer <[EMAIL PROTECTED]>wrote: > > easy_install remains a mystery to me in general. Try easy_install > sqlalchemy==0.5.0rc4 , or otherwise yeah delete out your dev versions. > > I use "easy_install --upgrade sqlalchemy": [EMAIL PROTECTED]:~/$ sudo easy_i

[sqlalchemy] Re: Unicode Results from SQL functions

2008-09-25 Thread Shawn Church
On Thu, Sep 25, 2008 at 6:47 AM, Michael Bayer <[EMAIL PROTECTED]>wrote: > Converting *all* strings to unicode would then lead to havoc as soon > as someone adds a Binary column to their schema. Another solution, > which we have support for, would be for ResultProxy to attempt to > match TypeEng

[sqlalchemy] Re: Unicode Results from SQL functions

2008-09-24 Thread Shawn Church
On Wed, Sep 24, 2008 at 11:04 PM, jason kirtland <[EMAIL PROTECTED]>wrote: > > Shawn Church wrote: > > > > > > On Wed, Sep 24, 2008 at 10:45 PM, jason kirtland <[EMAIL PROTECTED] > > <mailto:[EMAIL PROTECTED]>> wrote: > > > > > >

[sqlalchemy] Re: Unicode Results from SQL functions

2008-09-24 Thread Shawn Church
On Wed, Sep 24, 2008 at 10:45 PM, jason kirtland <[EMAIL PROTECTED]>wrote: > Adding ?charset=utf8&use_unicode=1 to your MySQL connection URL is a > much easier way to get Unicode back from all DB access. > Ok, that works. I thought that "create_engine(uri, encoding = "latin1", convert_unicode =

[sqlalchemy] Re: Unicode Results from SQL functions

2008-09-24 Thread Shawn Church
On Wed, Sep 24, 2008 at 7:37 PM, Michael Bayer <[EMAIL PROTECTED]>wrote: > we can of course add more functions to the list of "known" functions > such as ifnull() (it would be best if ifnull() is a SQL standard > function, I'm not sure if it is). > > Not sure this will work for IFNULL since it's t

[sqlalchemy] Unicode Results from SQL functions

2008-09-24 Thread Shawn Church
I am trying to construct a select query in mysql (version 5.0.51a-3ubuntu5.3-log) using SQL functions. Once I set the convert_unicode flag = True on my engine some function results are returned as type str and some results are returned as type unicode (I want, and expected, all unicode). Althou

[sqlalchemy] Re: Queries very slow for parsing Wikipedia dump -- any ideas for speeding it up?

2008-09-23 Thread Shawn Church
Hope the above helps. Shawn Church I/S Consultant shawn at SChurchComputers.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroup

[sqlalchemy] Question on SqlSoup

2008-08-30 Thread Shawn Church
, I WANT to explicitly issue the .commit's, so I hope I am understanding this correctly. I just need some clarification. I cannot find much recent information on SqlSoup by searching this list. Is it supported? Is it used? Can it be used in a production environment? Thanks, Shawn Churc