コード例 #1
0
ファイル: generator.py プロジェクト: nealedj/filmsonstage
    def save_templates_to_datastore(self, templates):
        futures = []
        for slug, raw in templates.items():
            template_obj = DrinkStaticTemplate.get_by_template_key(slug)
            if not template_obj:
                template_obj = DrinkStaticTemplate(slug=slug)
            template_obj.populate(
                source=raw
            )
            futures.append(template_obj.put_async())

        return futures
コード例 #2
0
ファイル: response.py プロジェクト: nealedj/filmsonstage
 def resolve_template(self, template):
     src = memcache.get(template)
     if not src:
         src = Template.get_by_template_key(template)
         memcache.set(template, src)
     return DjangoTemplate(src.source)