[sqlalchemy] Dynamic making of the where clause

2009-06-23 Thread Ash
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 (1,2,3,4) [ using in_] 3. d like %s [using like] now i want this 3 to stuff in

[sqlalchemy] Oracle: There are multiple tables visible...

2009-06-23 Thread Sven A. Schmidt
Hi, I've hit a problem very recently with autoloading of table info from an oracle schema which I believe is caused by a problem inside the _resolve_synonym method of oracle/base.py. I've googled around a bit but didn't find this issue reported previously. It may well be a problem with our db

[sqlalchemy] Why has sum been removed from sqlalchemy.orm.query.Query ?

2009-06-23 Thread Dan
Using sqlalchemy version 0.5.2, I've noticed that the sum method seems to have been removed from Query : session.query(MyClass).sum(MyClass.price) 'Query' object has no attribute 'sum' I can't find this change documented anywhere : it was present in 0.4 as I recall. Any reason for this ?

[sqlalchemy] Re: sqlalchemy 0.4.6 + python 2.3: many-to-many relation problem

2009-06-23 Thread Michael Bayer
david.radkow...@googlemail.com wrote: ha! got it! you were right, it's a vendor's python implementation problem. the custom python runtime put an instrumentation layer on top of other classes and that why it breaks :D switched to the genuine python 2.3.5 and now it's fine :) sowhy not

[sqlalchemy] Re: Validators: Define at table / mapper level ?

2009-06-23 Thread Michael Bayer
AF wrote: Hello, Can validators be defined at table / mapper level? (Is it even a good idea?) I ask, since it's at the table definition layer that I define what datatypes my columns have, so it seems natural to place the policing function there as well. a table level validator would

[sqlalchemy] Re: Oracle: There are multiple tables visible...

2009-06-23 Thread Michael Bayer
Sven A. Schmidt wrote: Hi, I've hit a problem very recently with autoloading of table info from an oracle schema which I believe is caused by a problem inside the _resolve_synonym method of oracle/base.py. I've googled around a bit but didn't find this issue reported previously. It may

[sqlalchemy] Re: Why has sum been removed from sqlalchemy.orm.query.Query ?

2009-06-23 Thread Michael Bayer
Dan wrote: Using sqlalchemy version 0.5.2, I've noticed that the sum method seems to have been removed from Query : session.query(MyClass).sum(MyClass.price) 'Query' object has no attribute 'sum' I can't find this change documented anywhere : it was present in 0.4 as I recall. looks

[sqlalchemy] Re: Why has sum been removed from sqlalchemy.orm.query.Query ?

2009-06-23 Thread Dan Jacob
That worked great, thanks for your help. 2009/6/23 Michael Bayer mike...@zzzcomputing.com: Dan wrote: Using sqlalchemy version 0.5.2, I've noticed that the sum method seems to have been removed from Query : session.query(MyClass).sum(MyClass.price) 'Query' object has no attribute 'sum'

[sqlalchemy] Re: many-to-many relation, 'secondaryjoin' is needed as well

2009-06-23 Thread Aculeus
Can you post your solution? On Jun 2, 6:38 am, Gera88 gger...@gmail.com wrote: Oh I did it Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to

[sqlalchemy] Re: Oracle: There are multiple tables visible...

2009-06-23 Thread Sven A. Schmidt
Michael, thanks for your reply! Unfortunately, I believe I have to use the synonyms feature, because I cannot use the table owner's schema owner to access the database. Everything works if I use the table owner's schema (AINV_OWNER) but the db policies forbid this for production, so I have to

[sqlalchemy] Re: Oracle: There are multiple tables visible...

2009-06-23 Thread Michael Bayer
Sven A. Schmidt wrote: Michael, thanks for your reply! Unfortunately, I believe I have to use the synonyms feature, because I cannot use the table owner's schema owner to access the database. Everything works if I use the table owner's schema (AINV_OWNER) but the db policies forbid this

[sqlalchemy] Re: Validators: Define at table / mapper level ?

2009-06-23 Thread allen.fowler
If you have mapper definitions separate from classes, theres nothing stopping you from adding attributes to the class over there, i.e. mapper(MyClass, mytable) MyClass.foo = some_validation_decorator(MyClass.foo) Personally I wouldn't bother (then again I use declarative for everything

[sqlalchemy] Re: sqlalchemy 0.4.6 + python 2.3: many-to-many relation problem

2009-06-23 Thread david.radkow...@googlemail.com
no chance :( legacy third party C extension libraries :( On Jun 23, 3:50 pm, Michael Bayer mike...@zzzcomputing.com wrote: david.radkow...@googlemail.com wrote: ha! got it! you were right, it's a vendor's python implementation problem. the custom python runtime put an instrumentation layer

[sqlalchemy] Re: preview an update?

2009-06-23 Thread Catherine Devlin
On Thu, Jun 18, 2009 at 4:57 PM, Michael Bayermike...@zzzcomputing.com wrote: you can get most of this stuff from the session without any flush occurring.  at the object level are the new, dirty, and deleted collections on Session.   At the attribute level the attributes.get_history() method

[sqlalchemy] Re: preview an update?

2009-06-23 Thread Michael Bayer
Catherine Devlin wrote: (['Eduardo Jones'], (), [u'Ed Jones']) # so far so good print sqlalchemy.orm.attributes.get_history(ed.userview, 'name') ((), [u'ed'], ()) print sqlalchemy.orm.attributes.get_history(ed, 'fullname') ((), ['Eduardo Jones'], ()) ... now get_history thinks fullname

[sqlalchemy] Re: How can I use count with group_by with webhelpers.paginate

2009-06-23 Thread Alisue
Thanks! That is the what i want. On 6月22日, 午後11:40, Michael Bayer mike...@zzzcomputing.com wrote: Alisue wrote: Oops. I found the solution with my self. like below. c.paginator = paginate.Page( meta.Session.query(Article).select_from(query.subquery()),