formatting changes
This commit is contained in:
parent
a56ec131de
commit
a5d07659eb
2
.gitignore
vendored
2
.gitignore
vendored
@ -3,6 +3,8 @@
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
.idea
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
Flask==1.0.2
|
||||
requests==2.20
|
||||
google.cloud.firestore==0.31.0
|
||||
Flask
|
||||
requests
|
||||
google-cloud.firestore
|
||||
|
@ -1,7 +1,4 @@
|
||||
from flask import Blueprint, render_template, abort
|
||||
from jinja2 import TemplateNotFound
|
||||
|
||||
from google.cloud import firestore
|
||||
from flask import Blueprint, render_template
|
||||
|
||||
from .db import getTagDicts, getPopulatedTagDict, getPopulatedTagDicts
|
||||
|
||||
@ -9,7 +6,7 @@ staticbucketurl = 'https://storage.googleapis.com/sarsooxyzstatic/'
|
||||
urlprefix = 'art'
|
||||
|
||||
art_print = Blueprint('art', __name__, template_folder='templates')
|
||||
#db = firestore.Client()
|
||||
|
||||
|
||||
@art_print.route('/')
|
||||
def root():
|
||||
@ -17,14 +14,14 @@ def root():
|
||||
#print(tags)
|
||||
return render_template('art/index.html', tags = tags, staticroot = staticbucketurl, urlprefix = urlprefix)
|
||||
|
||||
|
||||
@art_print.route('/<tag>')
|
||||
def tag_view(tag):
|
||||
tags = getPopulatedTagDict(tag)
|
||||
return render_template('art/all.html', staticroot = staticbucketurl, tags = [tags])
|
||||
|
||||
|
||||
@art_print.route('/all')
|
||||
def all():
|
||||
|
||||
sections = getPopulatedTagDicts()
|
||||
|
||||
return render_template('art/all.html', staticroot = staticbucketurl, tags=sections)
|
||||
|
@ -4,6 +4,7 @@ staticbucketurl = 'https://storage.googleapis.com/sarsooxyzstatic/'
|
||||
|
||||
fs = firestore.Client()
|
||||
|
||||
|
||||
def getTagDicts():
|
||||
|
||||
art_tags_collection = fs.collection(u'art_tags')
|
||||
@ -20,6 +21,7 @@ def getTagDicts():
|
||||
|
||||
return sorted(dicts, key=lambda k: k['index'])
|
||||
|
||||
|
||||
def getPopulatedTagDict(name):
|
||||
|
||||
name_doc = fs.document(u'art_tags/{}'.format(name))
|
||||
@ -34,6 +36,7 @@ def getPopulatedTagDict(name):
|
||||
|
||||
return tag_dicts
|
||||
|
||||
|
||||
def getPopulatedTagDicts():
|
||||
|
||||
tag_dicts = getTagDicts()
|
||||
|
@ -1,5 +1,4 @@
|
||||
from flask import Blueprint, render_template, abort
|
||||
from jinja2 import TemplateNotFound
|
||||
from flask import Blueprint, render_template
|
||||
import requests
|
||||
|
||||
from google.cloud import firestore
|
||||
|
@ -15,6 +15,7 @@ app.register_blueprint(music_print, url_prefix='/music')
|
||||
|
||||
staticbucketurl = 'https://storage.googleapis.com/sarsooxyzstatic/'
|
||||
|
||||
|
||||
@app.route('/')
|
||||
def main():
|
||||
|
||||
@ -32,10 +33,12 @@ def main():
|
||||
|
||||
return render_template('index.html', staticroot = staticbucketurl, splash = splashtext, art=art)
|
||||
|
||||
|
||||
@app.route('/dev')
|
||||
def dev():
|
||||
return render_template('dev.html')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(host='127.0.0.1', port=8080, debug=True)
|
||||
# [END gae_python37_app]
|
||||
|
Loading…
Reference in New Issue
Block a user