def render(self, include_common=True): self._set_render_properties() context = {} context['callback_name'] = 'doStuff_' + str(self._num) context['bg'] = self set_common_on_context(context, include_common) return j2_env.get_template('top_button_group.html').render(context).encode('utf-8')
def render(self, include_common=None): self._set_render_properties() context = {} context['callback_name'] = 'doStuff_' + str(self._num) context['super_filter'] = self context['super_filter_type'] = 'category' set_common_on_context(context, include_common) return j2_env.get_template('super_filter_template.html').render(context).encode('utf-8')
def render(self, include_common=None, freestanding=True): self._set_render_properties(freestanding) context = {} context['callback_name'] = 'doStuff_' + str(self._num) context['filter'] = self set_common_on_context(context, include_common) return j2_env.get_template('top_freestanding_filter.html').render(context).encode('utf-8')
def render(self, chart_type=None, include_common=None): """ Render chart code. chart_type is one-off type; not saved to underlying chart. By default, DO force common for render() """ self._set_render_properties(chart_type) context = {} context[self._context_name] = self context['callback_name'] = 'doStuff_' + str(self.num) set_common_on_context(context, include_common) return j2_env.get_template(self._template).render(context).encode('utf-8')
def render(self, include_common=None): num = get_joogle_object_counter() self._div_id = self._div_prefix + str(num) context = {} context[self._context_name] = self context['callback_name'] = 'doStuff_' + str(num) # call common context method before rendering all child # objects set_common_on_context(context, include_common) if hasattr(self, "_objects"): # container takes multiple objects for obj in self._objects: if isinstance(obj, (str, unicode)): self._content_strings.append(obj) else: self._content_strings.append(obj.render(include_common=False)) elif hasattr(self, "_content"): # container takes one object if isinstance(self._content, (str, unicode)): self._content_string = self._content else: self._content_string = self._content.render(include_common=False) # check if we need to include the Toggler prototype # if self._context_name == "toggler": # if ContainerRender._first_toggler: # ContainerRender._first_toggler = False # context["include_toggler_prototype"] = True return j2_env.get_template(self._template).render(context).encode('utf-8')