[Twisted-Python] SQLAlchemy and Twisted

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Fri May 7 12:36:40 MDT 2010


On 01:34 pm, mithrandi at mithrandi.net wrote:
>On Fri, May 7, 2010 at 12:53 PM, Konrads Smelkovs
><konrads.smelkovs at gmail.com> wrote:
>>If you want an ORM in Twisted look for STORM twisted integration. 
>>Overall,
>>it works (I tried). Some quirks are there, e.g. without twisted you 
>>would do
>>something like resultset[10:20].sort(Sort.ASC) but with twsited you 
>>have to
>>do (assuming inlineCallbacks)
>>
>>res= yield  resultset[10:20]
>>res = yield res.sort(Sort.ASC)
>
>If you wanted to, you could write this as:
>
>(yield resultset[10:20]).sort(Sort.ASC)
>
>assuming a new enough version of Python.

You left off one of the yields, though.

  res = yield (yield resultset[10:20]).sort(Sort.ASC)

Jean-Paul




More information about the Twisted-Python mailing list