def make_entry(self, el, entry): child_el = ElementTree.SubElement(el, 'title') child_el.text = self.entry_title(entry) child_el = ElementTree.SubElement(el, 'updated') child_el.text = self.entry_updated(entry).strftime(self._RFC3339) uri = self.entry_uri(entry) child_el = ElementTree.SubElement(el, 'id') child_el.text = uri child_el = ElementTree.SubElement(el, 'link', { 'rel': 'alternate', 'type': 'text/html', 'href': uri, }) child_el = ElementTree.SubElement(el, 'content', {'type': 'html',}) child_el.text = render(self.content_template, {'entry': entry,})
def direct_to_file(static_file, template, context=None): static_file.content = render(template, context)
def photo(static_file, album_slug, slug): static_file.content = render('/gallery/photo.html', { 'photo': models.album(album_slug).photo(slug), })
def album(static_file, slug): static_file.content = render('/gallery/album.html', { 'album': models.album(slug), })
def albums(static_file): static_file.content = render('/gallery/albums.html', { 'albums': models.albums(), })
def article(slug): return StaticFile(render('/blog/article.html', { 'article': models.article(slug), }))