Exemple #1
0
def index():
    if request.method == 'GET':
        # Optain a catalog list and a last 10 added item list
        catLst = dbi.getAllCategory()
        recentItemLst = dbi.getRecetItems(10)
        username = None
        useremail = None
        userid = None
        # Check for current logrd user
        credentials = login_session.get('credentials')
        if credentials is not None:
            username = login_session['username']
            useremail = login_session['email']
            userid = login_session['user_id']
        return render_template('nonloghome.html',
                               catLst=catLst,
                               recentItemLst=recentItemLst,
                               username=username,
                               useremail=useremail,
                               userid=userid)
Exemple #2
0
def recentItemJSON():
    recentItemLst = dbi.getRecetItems(10)
    return jsonify(resentItems=[i.serialize for i in recentItemLst])