def post(self): qx, dm, jy, uuid = request_get_values('qx', 'dm', 'jy', 'uuid') if uuid: dg = DG.objects(id=uuid).all().first() dg.update(qx=qx, dm=dm, jy=jy) else: if session.get('dg_data') and session.get( 'dg_data') != datetime.now().strftime('%Y%m%d'): print('!=') str_num_dg_list[0] = get_num() session['dg_data'] = datetime.now().strftime('%Y%m%d') DG(qx=qx, dm=dm, jy=jy, number=_get_number(str_num_dg_list[0])).save() return redirect(url_for('dg_blueprint.dg_list'))
def post(self): dj, sj, dm, jy, uuid = request_get_values('dj', 'sj', 'dm', 'jy', 'uuid') if uuid: zz = ZZ.objects(id=uuid).all().first() zz.update(dj=dj, sj=sj, dm=dm, jy=jy) else: if session.get('zz_data') and session.get( 'zz_data') != datetime.now().strftime('%Y%m%d'): str_num_zz_list[0] = get_num() session['zz_data'] = datetime.now().strftime('%Y%m%d') ZZ(dj=dj, sj=sj, dm=dm, jy=jy, number=_get_number(str_num_zz_list[0])).save() return redirect(url_for('zz_blueprint.zz_list'))
def get(self): uuid = request_get_values('uuid') ZZ.objects(id=uuid).delete() return redirect(url_for('zz_blueprint.zz_list'))
def get(self): uuid = request_get_values('uuid') zz = None if uuid: zz = ZZ.objects(id=uuid).all().first() return render_template('zz/edit.html', zz=zz)
def get(self): search = request_get_values('search') zz_list = ZZ.objects(number__contains=search).order_by('-number').all() return render_template('zz/list.html', items=zz_list, search=search)
def get(self): uuid = request_get_values('uuid') dg = None if uuid: dg = DG.objects(id=uuid).all().first() return render_template('dg/edit.html', dg=dg)