Do custom predicates solve your problem?
def extra_params(*params):
def _predicate(context, request):
request.extra_params = params
return True
@view_config(route_name='a_route', renderer='a_renderer',
custom_predicates=[extra_params('some_param')])
def v(request)
params = request.extra_params
return {}
If not, view_config also supports a few other constructs for wrapping
views (such as decorator).
On Sun, May 6, 2012 at 9:18 AM, Eric Lemoine
<[email protected]> wrote:
> Hi
>
> I'd like to be able to set custom config parameters in my views, and read
> these parameters from request objects. Is this at all possible?
>
> For example:
>
> @view_config(route_name='a_route', renderer='a_renderer',
> custom_param='some_value')
> def v(request)
> return {}
>
>
> Thanks.
>
>
> --
> Eric Lemoine
>
> Camptocamp France SAS
> Savoie Technolac, BP 352
> 73377 Le Bourget du Lac, Cedex
>
> Tel : 00 33 4 79 44 44 96
> Mail : [email protected]
> http://www.camptocamp.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/pylons-discuss?hl=en.
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en.