On Tue, Dec 23, 2014, 04:35 pyramidX <[email protected]> wrote:
Extracting the appstruct logic into a separate function is one way to go, though it still would be useful to have a way to conveniently create peppercorn POST values from appstructs. Especially for cases where the view logic is quite simple boilerplate (validate the form, submit the resulting appstruct somewhere and do a redirect) separating every view function into 2 could be avoided (e.g. register() and do_register(), with the latter being appstruct-only logic). You could probably use venusian to make a decorator for this boilerplate so that you just have one function that receives the request and appstruct. The benefit of venusian is that you can decorate the function for pyramid but import the function undecorated for testing. Of course, I understand what you're saying and maybe I'm trying too hard to avoid what could be a simple thing, but it's a nice opportunity to look at the options you have. -- 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 post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/pylons-discuss. For more options, visit https://groups.google.com/d/optout.
