Re: What's the best way to optimize database connections in Pyramid?

2011-03-16 Thread Stephen Lacy
Since mod_wsgi uses long-lived processes, I've decided to keep the connection open for the life of the process (and auto-reconnect if there's a failure). I'm actually a little surprised that people here are connecting disconnecting with each request, as it feels unnecessary. Is there some

Re: What's the best way to optimize database connections in Pyramid?

2011-03-16 Thread Daniel Holth
The normal strategy for databases is to use a connection pool. Conceptually the code gets a new connection each request but the pool may return an existing connection instead. Depending on the database this can be a big win; some databases connect so quickly that it hardly makes a difference.

Re: What's the best way to optimize database connections in Pyramid?

2011-03-16 Thread Vlad K.
This worked for me fine for another non-Pyramid app: class MongoModel(object): __dbconn = None def __init__(self, properties=None): self._id = None if properties: for k,v in properties.iteritems(): setattr(self, k, v if k != '_id' else

Re: webob.acceptparse __radd__

2011-03-16 Thread Chris McDonough
On Wed, 2011-03-16 at 10:18 -0700, Alexandre Conrad wrote: Ok, I figured it out: __radd__ function is only called if the left operand does not support the corresponding operation and the operands are of different types. For instance, to evaluate the expression x - y, where y is an instance

Re: GSOC status

2011-03-16 Thread Mike Orr
I started a list of potential GSOC projects. https://github.com/Pylons/pyramid/wiki/Gsoc2011 I'm not sure how many ppl have write access to the wiki, but I'll add anything I see mentioned on the list or that somebody emails me. On Wed, Mar 16, 2011 at 12:51 PM, Chris McDonough chr...@plope.com

Re: GSOC status

2011-03-16 Thread Joel Bohman
Hello! Great news, I would very much like to participate as a student. I'm a 4th year computer science student at Royal Institute of Technology in Stockholm, Sweden. I've been using Python for a few years now and it is my language of choice whenever applicable, been using it a lot during my