def jars_test(position, jar): if Card.objects(card_in_jar=jar, card_active=position): found_active = Card.objects(card_in_jar=jar, card_active=position).get() return found_active else: return template_card
def get_jar_positions(position): if Card.objects(card_in_jar=jar_from_url, card_active=position): found_active = Card.objects(card_in_jar=jar_from_url, card_active=position).get() return found_active else: # template card assigned at top # of this file for all routes to use return template_card
from flask import render_template, redirect, url_for from app import lumo_hub from app.block import Block from app.card import Card from app.card_steps import CardSteps from app.data_manipulation import get_incmplts_tuple from app.forms import NewCardForm, TodoButtons template_card = Card.objects(card_name='...').get() @lumo_hub.route('/', methods=['GET', 'POST']) @lumo_hub.route('/blocks/', methods=['GET', 'POST']) def blocks_view(): form = TodoButtons() tl = Block.objects.get(position='top_left') tm = Block.objects.get(position='top_mid') tr = Block.objects.get(position='top_right') ml = Block.objects.get(position='mid_left') mr = Block.objects.get(position='mid_right') bl = Block.objects.get(position='botm_left') bm = Block.objects.get(position='botm_mid') br = Block.objects.get(position='botm_right') block_positions = { 'tl': tl, 'tm': tm, 'tr': tr, 'ml': ml, 'mr': mr,