On 19-12-2013, Bert JW Regeer wrote:
> When and where is this nive context passed to Mako?
>
> Do note that the sample code you added is the same as the one for the 
> Pyramid context (not request) so it won’t work. You can’t have two 
> variables named context passed into a renderer…

I did exactly this, and it works :

class MakoLookupTemplateRenderer(object):
...
    def __call__(self, value, system):
        context = value.pop('context', None)
        if context is not None:
            value['nive_context'] = context
        context = system.pop('context', None)
        if context is not None:
            system['_context'] = context


If i log the call, i can see that context is both in value and system 
and is the same.
I will ask the author of nive, maybe i didn't do it correctly.

>
> On Dec 19, 2013, at 5:55, wilk <w...@flibuste.net> wrote:
>
>> Hi,
>> 
>> I try to use mako template with nive_cms, but they both use "context", 
>> so mako complain that it's a reserved name...
>> NameConflictError: Reserved words passed to render(): context
>> 
>> I've seen in pyramid_mako there is already a workaround to rename 
>> pyramid request to _request :
>> 
>> context = system.pop('context', None)
>> if context is not None:
>>    system['_context'] = context
>> 
>> 
>> Should i fork pyramid_mako to do the same with nive context (it works) ?
>> 
>> context = value.pop('context', None)
>> if context is not None:
>>    value['nive_context'] = context
>> 
>> Or is there a more elegant solution ?
>> 
>> -- 
>> Wilk
>> 
>> -- 
>> 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 pylons-discuss+unsubscr...@googlegroups.com.
>> To post to this group, send email to pylons-discuss@googlegroups.com.
>> Visit this group at http://groups.google.com/group/pylons-discuss.
>> For more options, visit https://groups.google.com/groups/opt_out.
>


-- 
Wilk

-- 
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 pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to