def virtual_items(): from utils import get_virtual_items item = get_virtual_items(g._user.id, g._sqldb) template = g._env.get_template('common/virtual_items.html') return template.render(user=g._user, item=item['children'], count=len(item['children']))
def move(id): from models import Virtual_item from utils import get_virtual_items template = g._env.get_template('templates/move.html') item = get_virtual_items(g._user.id, g._sqldb, 0, 0, False, True) virtual_item = g._db.query(Virtual_item).filter(Virtual_item.id == id).first() if virtual_item is not None: return template.render(items=item['children'], current_parent=virtual_item.parent_id, self_id=virtual_item.id) return 'Bad Request', 400
def index(): from utils import get_virtual_items item = get_virtual_items(g._user.id, g._sqldb) template = g._env.get_template('home.html') return template.render(user=g._user, item=item['children'], count=len(item['children']), page_title='Virtual view')
def create(): from utils import get_virtual_items template = g._env.get_template('templates/create.html') item = get_virtual_items(g._user.id, g._sqldb, 0, 0, False, True) return template.render(items=item['children'])