def home(): photos = get_last_photos(session['user']['nick']) users = get_users() return render_template('home.html', photos=photos, bucket=Config.S3_BUCKET_NAME, error=None, users=users)
def find_user(nick): u = find_by_nick(nick) photos = get_photo_by_user(u.nick) users = get_users() return render_template('home.html', photos=photos, bucket=Config.S3_BUCKET_NAME, error=None, visited_user=u)
def date_filter(): start = datetime.fromtimestamp( mktime(strptime(request.form['start'], "%d/%m/%Y"))) end = datetime.fromtimestamp( mktime(strptime(request.form['end'], "%d/%m/%Y"))) if start < end: photos = get_last_photos(session['user']['nick'], start, end) users = get_users() return render_template('home.html', photos=photos, bucket=Config.S3_BUCKET_NAME, error=None, users=users) else: flash(messages.INVALID_DATE_FILTER) return redirect(url_for("home_api.home"))
def resolve_get_users(*_): return get_users()
def all(db: Session = Depends(get_db)): return get_users(db)