def milestone_daily_action(): ddl_name = request.args.get('ddl_name', None) deadlines = xml_to_dict('app/xmls/dailywork.xml', reverse=True) data = None for ddl in deadlines: if ddl['name'] == ddl_name: data = ddl add_new('app/xmls/daily_milestones.xml', data) delete_element('dailywork.xml', ddl_name) deadlines = xml_to_dict('app/xmls/dailywork.xml', reverse=True) return render_template('daily.html', deadlines=deadlines)
def achieve_action(): ddl_name = request.args.get('ddl_name', None) deadlines = xml_to_dict('app/xmls/countdown.xml') data = None for ddl in deadlines: if ddl['name'] == ddl_name: data = ddl add_new('app/xmls/milestones.xml', data) delete_element('countdown.xml', ddl_name) deadlines = xml_to_dict('app/xmls/countdown.xml') return render_template('countdown.html', deadlines=deadlines)
def add_daily_task(): if request.method == 'POST': data = request.form print(data['Date']) date = datetime.strptime(data['Date'], '%Y-%m-%d') ddl = {} ddl['year'] = date.year ddl['month'] = date.month ddl['day'] = date.day ddl['name'] = data['name'] ddl['description'] = data['description'] ddl['last'] = '0' add_new('app/xmls/dailywork.xml', ddl) deadlines = xml_to_dict('app/xmls/dailywork.xml', reverse=True) return render_template('daily.html', deadlines=deadlines)
def milestones(): deadlines = xml_to_dict('app/xmls/milestones.xml') dailywork = xml_to_dict('app/xmls/daily_milestones.xml', reverse=True) return render_template('milestones.html', deadlines=deadlines, dailywork=dailywork)
def daily(): deadlines = xml_to_dict('app/xmls/dailywork.xml', reverse=True) return render_template('daily.html', deadlines=deadlines)
def countdown(): deadlines = xml_to_dict('app/xmls/countdown.xml') return render_template('countdown.html', deadlines=deadlines)
def undo_daily_action(): ddl_name = request.args.get('ddl_name', None) daily_update('dailywork.xml', ddl_name, undo=True) deadlines = xml_to_dict('app/xmls/dailywork.xml', reverse=True) return render_template('daily.html', deadlines=deadlines)
def delete_action(): ddl_name = request.args.get('ddl_name', None) delete_element('countdown.xml', ddl_name) deadlines = xml_to_dict('app/xmls/countdown.xml') return render_template('countdown.html', deadlines=deadlines)