On Sunday, June 7, 2015 at 12:48:15 AM UTC+2, Martin Stein wrote:
>
> @Gael: Interesting idea, I hadn't thought about that. Though the 
> no-arguments aspect might be a bit of a problem.
>
> The approach of attaching the schema to the request in the view-function:
> request.marshmallow_schema = UserOutputSchema()
>
> ... has another advantage besides allowing arguments: You can pick a 
> different schema depending on the request. For example, with a 
> GET-parameter like expand=True, you could pick the schema that serializes 
> relationships as well. Without that GET-parameter, you pick the simple 
> schema that doesn't serialize the relationships.
>
>
I guess that the standard way to override the renderer will work too:

http://docs.pylonsproject.org/docs/pyramid/en/latest/narr/renderers.html#overriding-a-renderer-at-runtime
 

-- 
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.

Reply via email to