X-Git-Url: https://git.mdrn.pl/django-ssify.git/blobdiff_plain/196df9e8170262c31790260d4e280b9981b557d1..af10b85180a1c533b43091d65ab724977a6d2e74:/ssify/variables.py?ds=sidebyside diff --git a/ssify/variables.py b/ssify/variables.py index e969450..46a787b 100644 --- a/ssify/variables.py +++ b/ssify/variables.py @@ -119,11 +119,11 @@ def ssi_expect(var, type_): class SsiVariableNode(template.Node): """ Node for the SsiVariable tags. """ - def __init__(self, tagpath, args, kwargs, vary=None, asvar=None): + def __init__(self, tagpath, args, kwargs, patch_response=None, asvar=None): self.tagpath = tagpath self.args = args self.kwargs = kwargs - self.vary = vary + self.patch_response = patch_response self.asvar = asvar def __repr__(self): @@ -137,9 +137,13 @@ class SsiVariableNode(template.Node): var = SsiVariable(self.tagpath, resolved_args, resolved_kwargs) request = context['request'] + if not hasattr(request, 'ssi_vars_needed'): + request.ssi_vars_needed = {} request.ssi_vars_needed[var.name] = var - if self.vary: - request.ssi_vary.update(self.vary) + if self.patch_response: + if not hasattr(request, 'ssi_patch_response'): + request.ssi_patch_response = [] + request.ssi_patch_response.extend(self.patch_response) if self.asvar: context.dicts[0][self.asvar] = var