first pass of reduced data so new files "button bar" could be used
This commit is contained in:
17
files.py
17
files.py
@@ -72,6 +72,11 @@ class File(db.Model):
|
||||
size_mb = db.Column(db.Integer, unique=False, nullable=False)
|
||||
hash = db.Column(db.Integer, unique=True, nullable=True)
|
||||
thumbnail = db.Column(db.String, unique=False, nullable=True)
|
||||
hash = db.Column(db.Integer)
|
||||
year = db.Column(db.Integer)
|
||||
month = db.Column(db.Integer)
|
||||
day = db.Column(db.Integer)
|
||||
woy = db.Column(db.Integer)
|
||||
|
||||
def __repr__(self):
|
||||
return "<eid: {}, size_mb={}, hash={}>".format(self.eid, self.size_mb, self.hash )
|
||||
@@ -97,7 +102,17 @@ def file_list():
|
||||
################################################################################
|
||||
@app.route("/files", methods=["GET"])
|
||||
def files():
|
||||
return render_template("files.html", page_title='View Files', entry_data=Entry.query.order_by(Entry.name).all())
|
||||
order_by="asc"
|
||||
grouping="day"
|
||||
which="week"
|
||||
if which == "week":
|
||||
year=File.query.order_by(File.year).first()
|
||||
woy=File.query.filter(File.year==year.year).order_by(File.woy).first()
|
||||
if order_by == "desc":
|
||||
entries=Entry.query.join(File).filter(File.year==year.year).filter(File.woy==woy.woy).order_by(Entry.name.desc()).all()
|
||||
else:
|
||||
entries=Entry.query.join(File).filter(File.year==year.year).filter(File.woy==woy.woy).order_by(Entry.name.desc()).all()
|
||||
return render_template("files.html", page_title='View Files', entry_data=entries )
|
||||
|
||||
################################################################################
|
||||
# /search -> show thumbnail view of files from import_path(s)
|
||||
|
||||
Reference in New Issue
Block a user