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
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.
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>
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
+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,