pyramid_tm 0.1 released

25 views
Skip to first unread message

Rocky Burt

unread,
Feb 25, 2011, 9:17:31 AM2/25/11
to pylons...@googlegroups.com
pyramid_tm 0.1 has been released.

``pyramid_tm`` is a package which allows Pyramid requests to join
the active transaction as provided by the `transaction

or ``docs/index.rst`` in this distribution for detailed
documentation.

Chris Withers

unread,
Feb 26, 2011, 3:27:20 AM2/26/11
to pylons...@googlegroups.com, Rocky Burt

ReST doesn't work so well in plain text emails ;-)

Out of interest, what was wrong with repoze.tm2 that it needed
re-implementing?

cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk

Wichert Akkerman

unread,
Feb 26, 2011, 5:18:27 AM2/26/11
to pylons...@googlegroups.com
On 2011-2-26 09:27, Chris Withers wrote:
> On 25/02/2011 14:17, Rocky Burt wrote:
>> pyramid_tm 0.1 has been released.
>>
>> ``pyramid_tm`` is a package which allows Pyramid requests to join
>> the active transaction as provided by the `transaction
>> <http://pypi.python.org/pypi/transaction>`_ package.
>>
>> See `http://docs.pylonsproject.org/projects/pyramid_tm/dev/
>> <http://docs.pylonsproject.org/projects/pyramid_tm/dev/>`_
>> or ``docs/index.rst`` in this distribution for detailed
>> documentation.
>
> ReST doesn't work so well in plain text emails ;-)
>
> Out of interest, what was wrong with repoze.tm2 that it needed
> re-implementing?

We had a mini-discussion on this topic on irc this week. The only
difference between the two is that repoze.tm2 uses middleware, while
pyramid_tm uses pyramid events.

Personally I am a bit worried about a trend to move away from reusable
WSGI middleware to pyramid-specific approaches, especially when there
appears to be no functional benefit.

Wichert.

--
Wichert Akkerman <wic...@wiggy.net> It is simple to make things.
http://www.wiggy.net/ It is hard to make things simple.

Chris Withers

unread,
Feb 28, 2011, 1:28:51 AM2/28/11
to pylons...@googlegroups.com
On 26/02/2011 10:18, Wichert Akkerman wrote:
> We had a mini-discussion on this topic on irc this week. The only
> difference between the two is that repoze.tm2 uses middleware, while
> pyramid_tm uses pyramid events.
>
> Personally I am a bit worried about a trend to move away from reusable
> WSGI middleware to pyramid-specific approaches, especially when there
> appears to be no functional benefit.

Indeed. Thanks for the clarification, I'll definitely stick with
repoze.tm2 then.

Mike Orr

unread,
Feb 28, 2011, 1:37:10 PM2/28/11
to pylons...@googlegroups.com
On Sun, Feb 27, 2011 at 10:28 PM, Chris Withers <ch...@simplistix.co.uk> wrote:
> On 26/02/2011 10:18, Wichert Akkerman wrote:
>>
>> We had a mini-discussion on this topic on irc this week. The only
>> difference between the two is that repoze.tm2 uses middleware, while
>> pyramid_tm uses pyramid events.
>>
>> Personally I am a bit worried about a trend to move away from reusable
>> WSGI middleware to pyramid-specific approaches, especially when there
>> appears to be no functional benefit.
>
> Indeed. Thanks for the clarification, I'll definitely stick with repoze.tm2
> then.

I haven't looked at pyramid_tm closely enough to tell whether it'll
work for pyramid_sqla, but the fact remains that WSGI is a clunky
protocol for services, and a non-middleware solution would be welcome.
The protocol is good for web servers and non-data services like error
handlers, but it forces a distortion in libraries that share data with
the application because you can't just call things directly, you have
to shoehorn the data into one dict or the HTTP headers, and any
interaction in views has to be via callback objects in the dict. It's
ironic that Jim Fulton used to complain that using middleware for data
services was an abuse of the protocol and framework/application
developers ignored him, but now after five years of use framework
developers are coming to the same conclusion for a different reason:
the WSGI protocol is just too artificial and rigid to use for data
services. You see that especially in repoze.who/what, which are overly
complex partly because of their middleware nature, and to an extent
Routes too. Generic reusable code is a good thing but it doesn't have
to be middleware. The various form libraries are reusable but they
aren't middleware.

--
Mike Orr <slugg...@gmail.com>

Chris McDonough

unread,
Feb 28, 2011, 1:43:51 PM2/28/11
to pylons...@googlegroups.com

I don't think there's a convenient generalization to apply here.

repoze.tm2 vs. pyramid_tm is more about opinion than it is technology
Both offer the same features and the same benefits, and neither has a
particular downside that isn't rooted in pure opinion.

On the other hand, there are cases where using middleware is clearly not
the right thing; I've been asked many times for example "how do I get to
the Pyramid registry from middleware I'm creating" and the answer is
always "if you need to do that, what you're creating is not meant to be
middleware".

- C


Chris Withers

unread,
Feb 28, 2011, 4:58:24 PM2/28/11
to pylons...@googlegroups.com
On 28/02/2011 18:43, Chris McDonough wrote:
> repoze.tm2 vs. pyramid_tm is more about opinion than it is technology
> Both offer the same features and the same benefits, and neither has a
> particular downside that isn't rooted in pure opinion.
>
> On the other hand, there are cases where using middleware is clearly not
> the right thing; I've been asked many times for example "how do I get to
> the Pyramid registry from middleware I'm creating" and the answer is
> always "if you need to do that, what you're creating is not meant to be
> middleware".

+lots to both of these paragraphs.

While I think r.who and r.what area bit of a stretch, Paste#auth_basic
is spot on as middlewear...

cheers,

Reply all
Reply to author
Forward
0 new messages