def render(self, context): bundle = template.Variable(self.bundle).resolve(context) variation = {} for key, value in self.variation.items(): variation[key] = template.Variable(value).resolve(context) return _render_include_media(bundle, variation)
def render(self, context): if "__tmplname__" not in context: raise Exception("You can't use tag {% media_meta %} with `MEDIA_BLOCKS` option seted to False") names = utils.get_media_bundles_names(context["__tmplname__"]) if self.custom_meta: names = filter(lambda n: n.endswith("." + self.custom_meta), names) if not len(names): return "<!-- WARNING: No bundles found for template %s -->" % context["__tmplname__"] return "\n".join([_render_include_media(name, {}) for name in names])
def render(self, context): if "__tmplname__" not in context: raise Exception( "You can't use tag {% media_meta %} with `MEDIA_BLOCKS` option seted to False" ) names = utils.get_media_bundles_names(context["__tmplname__"]) if self.custom_meta: names = filter(lambda n: n.endswith("." + self.custom_meta), names) if not len(names): return "<!-- WARNING: No bundles found for template %s -->" % context[ "__tmplname__"] return "\n".join([_render_include_media(name, {}) for name in names])
def _render(self, bundle, **variation): return mark_safe(_render_include_media(bundle, variation))
def render(self, context): bundle = self.bundle_var.eval(context) return _render_include_media(context['THEME_NAME'] + bundle, variation={})