[sqlalchemy] Re: Composite Pattern

2011-03-24 Thread Nickle
Thanks - sort knew what was needed - didn't know how to express it. Nick On Mar 24, 10:20 pm, Michael Bayer wrote: > On Mar 24, 2011, at 5:08 PM, Nickle wrote: > > > > > > > > > > > Doesn't quite work. > > > What I think is the problem is that when using secondary on the > > association table, t

Re: [sqlalchemy] Re: Composite Pattern

2011-03-24 Thread Michael Bayer
On Mar 24, 2011, at 5:08 PM, Nickle wrote: > Doesn't quite work. > > What I think is the problem is that when using secondary on the > association table, there are two foreign keys both referencing a > calendar. It doesn't know which to pick. > > union mapper looks like this > > union_calendar

[sqlalchemy] Re: Different behavior with pickling metadata with 0.7

2011-03-24 Thread botz
wonderful, thanks. On Mar 23, 3:41 pm, Michael Bayer wrote: > created ticket 2104 for this which is now fixed. > > On Mar 23, 2011, at 4:09 PM, botz wrote: > > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to

[sqlalchemy] Re: Composite Pattern

2011-03-24 Thread Nickle
Doesn't quite work. What I think is the problem is that when using secondary on the association table, there are two foreign keys both referencing a calendar. It doesn't know which to pick. union mapper looks like this union_calendar_mapper = \ mapper \ ( UnionCalendar,

[sqlalchemy] Querying with "not" - the python way (the same way python behaves)

2011-03-24 Thread Hector Blanco
Hello everyone. I was wondering what is the best way to perform a query filtering by "not" in a python-way. In python: >> not(None) True >> not(list()) True Let's say I have a class that has the typical "children" relationship: class Foo(declarative_base): __tablename__ = "foos"

[sqlalchemy] Re: Composite Pattern

2011-03-24 Thread Nickle
Thanks - I'll try and test tonight. On Mar 24, 4:29 pm, Michael Bayer wrote: > On Mar 24, 2011, at 4:40 AM, Nickle wrote: > > > > > > > > > > > I'm trying to implement a Composite > > Pattern,http://en.wikipedia.org/wiki/Composite_pattern > > > In this case its to represent some holiday calendar

Re: [sqlalchemy] Cursor objects in Sessions

2011-03-24 Thread Michael Bayer
On Mar 24, 2011, at 10:26 AM, Andrew wrote: > We have an application using SQLAlchemy to query an Oracle database. > We started to see errors with the QueuePool running out of > connections, so we upped the number of connections (and overflow). > However, now we're seeing behavior where, when run

Re: [sqlalchemy] Composite Pattern

2011-03-24 Thread Michael Bayer
On Mar 24, 2011, at 4:40 AM, Nickle wrote: > I'm trying to implement a Composite Pattern, > http://en.wikipedia.org/wiki/Composite_pattern > > In this case its to represent some holiday calendars. I need to > implement a union calendar that is a collection of other calendars. > > So a straight

Re: [sqlalchemy] What more can I do to avoid UnicodeEncodeError

2011-03-24 Thread Michael Bayer
On Mar 23, 2011, at 11:24 PM, ccooper wrote: > I am trying to store and retrieve unicode text in an sqlite database > and repeatedly run into UnicodeEncodeErrors. > > To start I am specifying the encoding in create_engine even though I > believe UTF-8 is default: > create_engine('sqlite:///

[sqlalchemy] Re: Cursor objects in Sessions

2011-03-24 Thread Andrew
Hm, that doesn't seem to quite answer my question. I want to know if manually getting and manipulating the cursor affects the ability for a Session to clean-up after itself. But thanks for your response! Andrew On Mar 24, 10:40 am, Jaimy Azle wrote: > On Thursday, March 24, 2011, 9:26:01 PM, A

Re: [sqlalchemy] I'm missing something with the session...

2011-03-24 Thread Hector Blanco
Oh... I'll give it a try... I'm using some parts of z3c.saconfig without knowing too well what they do... I took this tutorial: http://grok.zope.org/documentation/how-to/orm-using-megrok.rdb-and-sqlalchemy ... and I didn't look much further. I'll try to dig into the packages you mentioned. Looks

Re: [sqlalchemy] Cursor objects in Sessions

2011-03-24 Thread Jaimy Azle
On Thursday, March 24, 2011, 9:26:01 PM, Andrew wrote: > We have an application using SQLAlchemy to query an Oracle database. > We started to see errors with the QueuePool running out of > connections, so we upped the number of connections (and overflow). > However, now we're seeing behavior where

[sqlalchemy] Cursor objects in Sessions

2011-03-24 Thread Andrew
We have an application using SQLAlchemy to query an Oracle database. We started to see errors with the QueuePool running out of connections, so we upped the number of connections (and overflow). However, now we're seeing behavior where, when running in mod_wsgi, the number of Apache processes goes

[sqlalchemy] Composite Pattern

2011-03-24 Thread Nickle
I'm trying to implement a Composite Pattern, http://en.wikipedia.org/wiki/Composite_pattern In this case its to represent some holiday calendars. I need to implement a union calendar that is a collection of other calendars. So a straightforward hierarchy. Calendar, abstract as the top level clas

Re: [sqlalchemy] I'm missing something with the session...

2011-03-24 Thread Wichert Akkerman
On 3/23/11 23:11 , Hector Blanco wrote: Yeah... the closing thing is because this is going to be in a webserver, and the framework that controls the requests really, really messed up everything (mysql daemon, sqlalchemy...) if the http request was canceled (If I had a user pressing F5 in Firefox