def get_all_goals(page): if page == "start": return render_template('index.html', events=splitstat(mongo.getall('event', {})), title='Banshe') elif page == "edit": return render_template('editgoal.html')
def get_todos(): output = [] for i in mongo.getall('todo', {}): output.append({ 'goal_id': str(i['goal_id']), 'todo_name': i['todo_name'], 'todo_status': i['todo_status'] }) return jsonify(output)
def get_goals_week(): output = [] for i in mongo.getall('event', {}): event = makeevent(i) slice = event.getslice().week deadline = datetime.strptime(i['event_deadline'], '%Y-%m-%d %H:%M:%S').date() if slice[0].date() <= deadline <= slice[1].date(): output.append(i) return render_template('index.html', events=splitstat(output), title='Banshe')