本文整理汇总了Python中models.Employee.is_valid_grade_step方法的典型用法代码示例。如果您正苦于以下问题:Python Employee.is_valid_grade_step方法的具体用法?Python Employee.is_valid_grade_step怎么用?Python Employee.is_valid_grade_step使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Employee
的用法示例。
在下文中一共展示了Employee.is_valid_grade_step方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _valid_emp
# 需要导入模块: from models import Employee [as 别名]
# 或者: from models.Employee import is_valid_grade_step [as 别名]
def _valid_emp(self):
name = self.ui.nameEdit.text()
if not Employee.is_valid_name(name):
msg = 'Employee name is invalid'
QMessageBox.critical(QMessageBox(), 'Input Error', msg)
self.ui.nameEdit.setFocus()
return None
grade = self.ui.gradeEdit.text()
if not Employee.is_valid_grade_step(grade):
msg = 'Employee grade is invalid'
QMessageBox.critical(QMessageBox(), 'Input Error', msg)
self.ui.gradeEdit.setFocus()
return None
step = self.ui.stepEdit.text()
if not Employee.is_valid_grade_step(step):
msg = 'Employee step is invalid'
QMessageBox.critical(QMessageBox(), 'Input Error', msg)
self.ui.stepEdit.setFocus()
return None
fte = self.ui.fteEdit.text()
if not Employee.is_valid_fte(fte):
msg = 'Employee FTE is invalid'
QMessageBox.critical(QMessageBox(), 'Input Error', msg)
self.ui.fteEdit.setFocus()
return None
cp = '015' if self.ui.cp15Button.isChecked() else '016'
investigator = self.ui.investigatorBox.isChecked()
notes = self.ui.notesEdit.toPlainText()
return Employee([
self.cur_rec_id,
name,
int(grade),
int(step),
int(fte),
cp,
investigator,
notes
])