示例#1
0
文件: views.py 项目: 32x32/fufufuu
    def render_to_response(self, context):
        template = TEMPLATE_ENV.get_template(self.template_name)

        context['TEMPLATE_NAME'] = self.template_name.split('/')[-1].split('.')[0]
        for processor in get_standard_processors():
            context.update(processor(self.request))

        response = HttpResponse(content=template.render(**context))
        response.template_name = self.template_name
        return response
示例#2
0
文件: models.py 项目: 32x32/fufufuu
 def email_text(self):
     return TEMPLATE_ENV.get_template('report/report-manga-email.txt').render({'report': self})
示例#3
0
文件: mixins.py 项目: 32x32/fufufuu
 def info_text(self):
     return TEMPLATE_ENV.get_template('manga/manga-archive-info.txt').render({'manga': self})