I've been using Formencode throughout for both form validation and config settings validation. Thanks for porting it to Pyramid and Python 3 and dealing with changes within Python 3: I remember all of those broke functionality until Formencode was patched.
On Tue, Apr 1, 2025 at 2:20 PM Jonathan Vanasco <[email protected]> wrote: > > i forgot to mention - if your app uses formencode for validation, I ported > the pylons validation to pyramid a long time ago and still actively use and > maintain it - https://github.com/jvanasco/pyramid_formencode_classic > > > On Tuesday, April 1, 2025 at 1:14:08 PM UTC-4 Jonathan Vanasco wrote: >> >> Pyramid offers a few ways to implement the routes/controllers. >> >> The easiest when porting from Pylons is to use classes with @viewconfig, >> that can mimic the pylons handler classes. >> >> This is a good example of that approach in the regular pyramid docs: >> https://docs.pylonsproject.org/projects/pyramid_cookbook/en/latest/pylons/views.html >> >> Pretty much everything can be supported and migrated with not too much work, >> except for the globals. IIRC Pylons did some weird stuff with globals that >> wasn't necessarily threadsafe. When moving to pyramid you can use events to >> define/translate "globals" into templates. For the python code, you can >> also update code to not use globals and take a context object as the first >> argument. The context object could be a request, or an object that wraps a >> request. >> >> In terms of templating - if there isn't a genshi package you could probably >> model one after pyramid_mako and port the pylons package over. It might be >> much faster to do that, and then lightly adapt the templates, then reinvent >> everything. >> >> >> On Tuesday, April 1, 2025 at 6:48:01 AM UTC-4 Milan Kelesi wrote: >>> >>> Hello, >>> >>> We are planning to migrate an existing project from Pylons 1.0.2 to Pyramid >>> 2.x. >>> What would be the best approach to start? >>> I understand we need to rewrite all the controllers. >>> We are using Genshi templates and this does not seem to be supported in >>> Pyramid 2. What would be the easiest template engine to migrate to from >>> Genshi (Mako, Jinja2, Chameleon, ..) >>> Is there an easy way to reuse the existing routes, globals, application >>> setup? >>> I am currently a bit overwhelmed and not sure where to start. >>> I would like to get a quick win and get one simple route/controller without >>> authentication to work under pyramid. >>> >>> Thanks for any advice. > > -- > 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 [email protected]. > To view this discussion visit > https://groups.google.com/d/msgid/pylons-discuss/7411399e-9ec1-4411-9e45-5b53fcc823ebn%40googlegroups.com. -- Mike Orr <[email protected]> -- 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 [email protected]. To view this discussion visit https://groups.google.com/d/msgid/pylons-discuss/CAH9f%3DupK52ipXRv22E8W%2BB%2BRCm81OyS1-p5Y2VVKkBv4Sq5s9g%40mail.gmail.com.
