def browse(): start = time.time() filterType = utils.intOrNone(request.args.get('type', None)) filterMedium = utils.intOrNone(request.args.get('medium', None)) mediums = Medium.all() styles = Style.all() types = Type.all() supports = Support.all() baseQuery = Artwork.reviewedArt().order_by(Artwork.created_on) if filterType: baseQuery = baseQuery.filter(Artwork.type == filterType) if filterMedium: baseQuery = baseQuery.filter(Artwork.medium == filterMedium) artwork = baseQuery.all() app.logger.debug('Queries took: %fs' % (time.time() - start)) return render_template('browse.html', artwork=artwork, numArts=len(artwork), mediums=mediums, styles=styles, types=types, supports=supports, filterType=filterType, filterMedium=filterMedium)
def browse(): start = time.time() filterType = utils.intOrNone(request.args.get('type',None)) filterMedium = utils.intOrNone(request.args.get('medium',None)) mediums = Medium.all() styles = Style.all() types = Type.all() supports = Support.all() baseQuery = Artwork.reviewedArt().order_by(Artwork.created_on) if filterType: baseQuery = baseQuery.filter(Artwork.type == filterType) if filterMedium: baseQuery = baseQuery.filter(Artwork.medium == filterMedium) artwork = baseQuery.all() app.logger.debug('Queries took: %fs' % (time.time() - start) ) return render_template('browse.html', artwork=artwork, numArts = len(artwork), mediums=mediums,styles=styles,types=types,supports=supports, filterType=filterType, filterMedium=filterMedium)
def _browse(): type = request.args.get('type', -1, type=int) medium = request.args.get('medium', -1, type=int) art = Artwork.reviewedArt().all() return jsonify(arts=[a.json() for a in art])
def home(): artwork = Artwork.reviewedArt().order_by( Artwork.created_on).limit(10).all() return render_template('home.html', recentArtwork=artwork)
def home(): artwork = Artwork.reviewedArt().order_by(Artwork.created_on).limit(10).all() return render_template('home.html', recentArtwork = artwork)