def get(self): attachments = "" for a in Attachment.all(): attachments += attachmentTemplate.render({ 'name': a.name, 'thumbnail': a.thumbnail, 'key': a.key() }) self.response.out.write(indexTemplate.render({ 'title': 'Attachments', 'body': attachments, 'active_page': 'attachments' }))
def render(self): attachments = "" for a in Attachment.all().filter("entry =", self.key()): attachments += attachmentTemplate.render({ 'name': a.name, 'thumbnail': a.thumbnail, 'key': a.key() }) return entryTemplate.render({ 'entry_day': self.date.strftime("%A, %d %B"), 'content': markup_text(self.content), 'creation_time': pytz.utc.localize(self.creation_time).astimezone( local_tz).strftime("%A, %d %B - %H:%M"), 'attachments': attachments, 'key': self.key() })