Did you had a look at "pyramid_es" package?
It provides a custom data manager for ElasticSearch...

Regards,
Thierry

2017-01-23 20:19 GMT+01:00 Kai Groner <k...@gronr.com>:

> I found the data manager interface somewhat convoluted, so I wrote some
> adapters that allow you to write datamanagers as generator functions
> (similar to contextlib.contextmanager).
>
> @datamanager
> def transactionally_do_something():
>     try:
>         # BEGIN
>         yield
>         # VOTE
>         yield
>     except Exception:
>         # ABORT
>         raise
>     else:
>         # FINISH
>
> There's also a @commitmanager version which skips the BEGIN phase if you
> have nothing to put there, and there are inline flavors of both for
> attaching a one-off datamanager to the current transaction.
>
> https://gist.github.com/groner/ae63a62ded7d6dbdfb3397f264300b16
>
>
>
> Kai
>
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pylons-discuss+unsubscr...@googlegroups.com.
> To post to this group, send email to pylons-discuss@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/pylons-discuss/CALiRuxkN_HqTAyLv-TThmc4WU4Fvh_5X%3D5T6KmEJ_
> BHFUE%2B44w%40mail.gmail.com
> <https://groups.google.com/d/msgid/pylons-discuss/CALiRuxkN_HqTAyLv-TThmc4WU4Fvh_5X%3D5T6KmEJ_BHFUE%2B44w%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
http://www.imagesdusport.com -- http://www.ztfy.org

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/CAPX_VWCB2878w7YPDvAYnh9JFBMz%3DHfQ54p4k%3DFPv0%2BssTwm9g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to