def resolve_template(self, template):
		if isinstance(template, (list, tuple)):
			return jinja_env.select_template(template)
		elif isinstance(template, basestring):
			return jinja_env.get_template(template)
		else:
			return template
Beispiel #2
0
	def get_rendered_macro(self, macro_name, template_name = None, **context):
		if template_name is None:
			template_name = self.get_template_names()
		
		template = jinja_env.get_template(template_name).module
		template_block = getattr(template, macro_name, None)
		
		if template_block is None:
			return ''
		
		return template_block(**context)
	def template_module(self):
		return jinja_env.get_template('asymmetricbase/boundfield/default.djhtml').module