本文整理汇总了Python中form.Form.vals['LOCK_STATUS']方法的典型用法代码示例。如果您正苦于以下问题:Python Form.vals['LOCK_STATUS']方法的具体用法?Python Form.vals['LOCK_STATUS']怎么用?Python Form.vals['LOCK_STATUS']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类form.Form
的用法示例。
在下文中一共展示了Form.vals['LOCK_STATUS']方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: new_record
# 需要导入模块: from form import Form [as 别名]
# 或者: from form.Form import vals['LOCK_STATUS'] [as 别名]
def new_record(self, event):
"""Insert new record.
Get values by presenting an empty form"""
# does user want to fill with template ?
template_name = None
# show template chooser only if there are some templates
if len(self.tpl_files) > 0:
template_chooser = TemplateChooser(None, self.project_dir, self.tpl_files)
if template_chooser.ShowModal() == wx.ID_CANCEL:
return
elif template_chooser.ShowModal() == wx.ID_OK:
template_name = template_chooser.chosentemplate
template_chooser.Destroy()
if template_name == None:
form = Form(None, self.fields_file, 'Fill in the values')
else:
template_vals = yaml.load(open(template_name))
form = Form(None, self.fields_file, 'Fill in the values', template_vals)
if form.ShowModal() == wx.ID_OK:
form.get_values()
# Initialise lock as open
form.vals['LOCK_STATUS'] = 'unlocked'
self.records.insert_record(form.vals)
# recreate index
#self.register.index_summary = self.records.create_index()
self.register.refresh_records()
form.Destroy()