Hi,

is there something similar to pyramid_handlers for traversal but instead
using the view name?

I would like to do something like this:

@view_config(context=Foo, ...)
class ViewHandler(object):
    def __init__(self, context, request):
        self.context = context
        self.request = request
        # do some processing

    def view(self):
        # process requests with view_name='view'

    def edit(self):
        # process requests with view_name='edit'

Because I have some common processing and this way I wouldn't have to
call do_processing(context, request) or whatever in every view handler
method.

If there is nothing like this available, what do you think about it?
Would you rather go for decorating all the methods directly?

I guess the "right" way to implement this would be with a view mapper,
right? But how can I register a view for all view_names?

Cheers,
Benjamin

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to