[Twisted-Python] How to properly return a dict from adbapi
"Einar S. Idsø"
einar.twisted at norsk-esport.no
Sat Feb 24 19:27:12 EST 2007
L. Daniel Burr wrote:
> This is very easy to do, because adbapi.ConnectionPool will pass on
> connection-specific parameters to the underlying DBAPI module.
> Example (untested):
> pool = db.ConnectionPool(
Wow, thank you! Now /there/ is the proper way of returning a dict :) I
just can't believe it was that easy...
> The key thing to understand in this case is that adbapi is just a simple
> wrapper around a given DBAPI module, so if you know how to configure
> MySQLdb, then configuring adbapi.ConnectionPool is very similar. Just
> pass the same keyword args to ConnectionPool, that you would pass to
> MySQLdb, and you're good to go.
> Hope this helps,
> L. Daniel Burr
It was just the help I needed: An example to solve my problem, and a
much-needed explanation of adbapi. Perfect!
Thank you so much,
More information about the Twisted-Python