def submit(self):
ids = self.ids
time = ids.time.text
date = ids.date.text
bg = ids.bg.text
carbs = ids.carbs.text
bolus = ids.bolus.text
notes = ids.notes.text
if time != '' and date != '' and (bg != '' or carbs != '' or bolus != '' or notes != ''):
if bg == '':
bg = 0
if carbs == '':
carbs = 0
if bolus == '':
bolus = 0
if notes == '':
notes = ' '
datetime = date + ' ' + time
self.dm.new_entry(datetime, bg, carbs, bolus, notes)
Clock.schedule_once(datascreen.refresh, 2)
self.dismiss()
评论列表
文章目录