def get(self): files = File.all().ancestor(FILE_LIST).order('-uploaded_at') tag = self.request.GET.get('tag') if tag: files = files.filter('tags =', tag) file_list = template.variable() for f in files: print >>file_list, '<tr>' print >>file_list, '<td><a href="/download/%s">%s</a></td>' \ % (f.name, f.name) print >>file_list, '<td>' for tag in f.tags: print >>file_list, '<a href="/list?tag=%s">%s</a>' \ % (tag, tag) print >>file_list, '</td>' print >>file_list, '</tr>' html = template.render( 'list.html', {'file_list': file_list}, escaped=False ) self.response.write(html)
def get(self): files = template.variable() tagQuery = self.request.get('tag') if (tagQuery): for f in File.all().ancestor(FILE_LIST).filter("tag =", tagQuery).order('-uploaded_at'): fileString = '<li><a href="/download/%s">%s</a> Tags:' \ % (f.name, f.name) for t in f.tag: fileString += '<a href="/list?tag=%s">%s</a>, ' \ % (t, t) print >>files, fileString else: for f in File.all().ancestor(FILE_LIST).order('-uploaded_at'): fileString = '<li><a href="/download/%s">%s</a> Tags:' \ % (f.name, f.name) for t in f.tag: fileString += '<a href="/list?tag=%s">%s</a>, ' \ % (t, t) print >>files, fileString html = template.render( 'list.html', {'file_list': files}, escaped=False ) self.response.write(html)
def get(self): files = template.variable() for f in File.all().ancestor(FILE_LIST).order('-uploaded_at'): print >>files, '<li><a href="/download/%s">%s</a></li>' \ % (f.name, f.name) html = template.render('list.html', {'file_list': files}, escaped=False) self.response.write(html)
def get(self): files = template.variable() for f in File.all().ancestor(FILE_LIST).order('-uploaded_at'): print >>files, '<li><a href="/download/%s">%s</a></li>' \ % (f.name, f.name) html = template.render( 'list.html', {'file_list': files}, escaped=False ) self.response.write(html)
def get(self): files = File.all().ancestor(FILE_LIST).order('-uploaded_at') tag = self.request.GET.get('tag') if tag: files = files.filter('tags =', tag) file_list = template.variable() for f in files: print >> file_list, '<tr>' print >>file_list, '<td><a href="/download/%s">%s</a></td>' \ % (f.name, f.name) print >> file_list, '<td>' for tag in f.tags: print >>file_list, '<a href="/list?tag=%s">%s</a>' \ % (tag, tag) print >> file_list, '</td>' print >> file_list, '</tr>' html = template.render('list.html', {'file_list': file_list}, escaped=False) self.response.write(html)