cleanup
This commit is contained in:
parent
c8b6d4398d
commit
a0e8fd91a8
16
main.py
16
main.py
@ -22,7 +22,7 @@ def art():
|
|||||||
art_tags_collection = db.collection(u'art_tags')
|
art_tags_collection = db.collection(u'art_tags')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
pics = art_collection.get()
|
#pics = art_collection.get()
|
||||||
tags = art_tags_collection.get()
|
tags = art_tags_collection.get()
|
||||||
except google.cloud.exceptions.NotFound:
|
except google.cloud.exceptions.NotFound:
|
||||||
return 'no such document'
|
return 'no such document'
|
||||||
@ -42,17 +42,7 @@ def art():
|
|||||||
#sections.append({tag_dict['name']: image_list})
|
#sections.append({tag_dict['name']: image_list})
|
||||||
sections.append({'images': image_list, 'name': tag_dict['name'], 'description': tag_dict['description'], 'index': tag_dict['index']})
|
sections.append({'images': image_list, 'name': tag_dict['name'], 'description': tag_dict['description'], 'index': tag_dict['index']})
|
||||||
|
|
||||||
print(sections[0])
|
#print(sections[0])
|
||||||
|
|
||||||
#categories = []
|
|
||||||
#for tag in tags:
|
|
||||||
#taglist = {
|
|
||||||
#tag.to_dict()['name'] : []
|
|
||||||
#}
|
|
||||||
#print(tag.to_dict())
|
|
||||||
#categories.append(taglist)
|
|
||||||
|
|
||||||
#print(categories)
|
|
||||||
|
|
||||||
images = []
|
images = []
|
||||||
for doc in pics:
|
for doc in pics:
|
||||||
@ -60,7 +50,7 @@ def art():
|
|||||||
images.append(doc.to_dict())
|
images.append(doc.to_dict())
|
||||||
#categories[categories.index(image['tag'])].append(image)
|
#categories[categories.index(image['tag'])].append(image)
|
||||||
|
|
||||||
return render_template('art.html', staticroot = staticbucketurl, images=images, tags=sections)
|
return render_template('art.html', staticroot = staticbucketurl, tags=sections)
|
||||||
|
|
||||||
@app.route('/dev')
|
@app.route('/dev')
|
||||||
def dev():
|
def dev():
|
||||||
|
Loading…
Reference in New Issue
Block a user