Hey Mike…

Am Freitag, den 14.01.2011, 19:53 -0800 schrieb Mike Orr:
> Hi all, I'm starting an article on Pyramid for Pylons 1 users,
> focusing on the differences between the frameworks and how to do
> familiar things in Pyramid. It'll also cover add-on stuff like forms
> and auth, or at least list the alternatives available.
> 
> I'm wondering if there are any particular questions people would like
> included. If so, please email them to me.

I took a few notes while I was moving from Pylons to Pyramid. I'm not
completely there yet so I only have partial insight. Maybe it helps
though:

Pyramid seems like a Pylons but a lot more tidied up.

public/ -> static/

:5000 -> :6543

Controller actions -> views

config/routing.py -> foo/__init__.py (views)
(no more "paster controller foo")

c.* context -> "return {'foo':'bar'}" via a view

Templates are rendered as Mako if they have a *.mak or *.mako suffix.
(I didn't find much useful information at a glance on ZPT.)

Traversal is mighty but I probably don't need it.
(At first I thought that I'm missing out a lot when I don't use them.
But now I believe that they are rather something very special with the
"routing tree" stored in some kind of data storage. It doesn't make me
look stupider if I stay with URL dispatching.)

Pylons exceptions -> return HTTPFound
(non-200 responses don't need exceptions any more but rather return
proper objects)

Database init code is now completely in model/__init__.py
(no config/* files any more)

"paster shell" has fewer things preconfigured. Issuing a request needs
something like:
>>> from myproject.views import my_view
>>> from pyramid.request import Request
>>> r = Request.blank('/')
>>> my_view(r)

…Christoph

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to