本文整理汇总了Python中DoctorSpring.models.User.status方法的典型用法代码示例。如果您正苦于以下问题:Python User.status方法的具体用法?Python User.status怎么用?Python User.status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DoctorSpring.models.User
的用法示例。
在下文中一共展示了User.status方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_addKefu
# 需要导入模块: from DoctorSpring.models import User [as 别名]
# 或者: from DoctorSpring.models.User import status [as 别名]
def test_addKefu(self):
user=User('kefu','77777777777','123456')
user.sex=0
user.status=0
user.email='[email protected]'
user.address='四川省 通江县'
user.phone = '77777777777'
user.type = UserStatus.doctor
user.name = "客服人员"
User.save(user)
new_userrole2 = UserRole(user.id, RoleId.Kefu)
UserRole.save(new_userrole2)
示例2: test_addFenzhen
# 需要导入模块: from DoctorSpring.models import User [as 别名]
# 或者: from DoctorSpring.models.User import status [as 别名]
def test_addFenzhen(self):
user=User('fenzhen','13426026573','123456')
user.sex=0
user.status=0
user.email='[email protected]'
user.address='四川省 通江县'
user.phone = '13426026573'
user.type = UserStatus.doctor
user.name = "分诊医生"
User.save(user)
new_userrole2 = UserRole(user.id, RoleId.Admin)
UserRole.save(new_userrole2)
示例3: test_addPatient
# 需要导入模块: from DoctorSpring.models import User [as 别名]
# 或者: from DoctorSpring.models.User import status [as 别名]
def test_addPatient(self):
user=User('liclu','15210892443','123456')
user.sex=0
user.status=0
user.email='[email protected]'
user.address='四川省 通江县'
user.phone = '15210892443'
User.save(user)
patient=Patient()
patient.gender=0
patient.Name='程成'
patient.status=0
patient.userID=user.id
Patient.save(patient)
new_userrole = UserRole(user.id, RoleId.Patient)
UserRole.save(new_userrole)
示例4: test_addSuperUser
# 需要导入模块: from DoctorSpring.models import User [as 别名]
# 或者: from DoctorSpring.models.User import status [as 别名]
def test_addSuperUser(self):
user=User('zhoufan','13426026573','123456')
user.sex=0
user.status=0
user.email='[email protected]'
user.address='四川省 通江县'
user.phone = '13426026573'
user.type = UserStatus.doctor
user.name = "张西"
User.save(user)
patient=Patient()
patient.gender=0
patient.Name='zf'
patient.status=0
patient.userID=user.id
Patient.save(patient)
new_userrole = UserRole(user.id, RoleId.Patient)
UserRole.save(new_userrole)
new_doctor_1 = Doctor(user.id)
new_doctor_1.identityPhone = "029-12345567"
new_doctor_1.username = "张西"
new_doctor_1.diagnoseCount = 10
new_doctor_1.feedbackCount = 5
new_doctor_1.goodFeedbackCount = 5
new_doctor_1.hospitalId = 1
new_doctor_1.departmentId = 1
new_doctor_1.title = "副主任医师"
new_doctor_1.status = 0
Doctor.save(new_doctor_1)
new_doctor2skill_1_1 = Doctor2Skill(new_doctor_1.id,1)
Doctor2Skill.save(new_doctor2skill_1_1)
new_userrole1 = UserRole(user.id, RoleId.Doctor)
UserRole.save(new_userrole1)
new_userrole2 = UserRole(user.id, RoleId.Admin)
UserRole.save(new_userrole2)
示例5: register_doctor
# 需要导入模块: from DoctorSpring.models import User [as 别名]
# 或者: from DoctorSpring.models.User import status [as 别名]
def register_doctor():
form = RegisterFormDoctor(request.form)
form_result = form.validate()
if form_result.status == rs.SUCCESS.status:
new_user = User(form.real_name, form.username, form.password)
new_user.email = form.email
new_user.phone = form.cellphone
new_user.type = UserStatus.doctor
new_user.status = ModelStatus.Draft
User.save(new_user)
new_doctor = Doctor(new_user.id)
new_doctor.username = form.real_name
new_doctor.identityPhone = form.identity_phone
Doctor.save(new_doctor)
new_doctor2skill = Doctor2Skill(new_doctor.id, 1)
Doctor2Skill.save(new_doctor2skill)
new_userrole = UserRole(new_user.id, RoleId.Doctor)
UserRole.save(new_userrole)
return jsonify(form_result.__dict__)
示例6: applyDiagnoseForm
# 需要导入模块: from DoctorSpring.models import User [as 别名]
# 或者: from DoctorSpring.models.User import status [as 别名]
def applyDiagnoseForm(formid):
if (int(formid) == 1) :
form = DiagnoseForm3(request.form)
form_result = form.validate()
if form_result.status == rs.SUCCESS.status:
if(form.diagnoseId):
new_diagnose = Diagnose.getDiagnoseById(form.diagnoseId)
else:
new_diagnose = Diagnose.getNewDiagnoseByStatus(DiagnoseStatus.Draft, session['userId'])
if(new_diagnose is None):
new_diagnose = Diagnose()
new_diagnose.status = DiagnoseStatus.Draft
new_diagnose.doctorId = form.doctorId
new_diagnose.uploadUserId = session['userId']
Diagnose.save(new_diagnose)
form_result.data = {'formId': 2, 'diagnoseId': new_diagnose.id}
return jsonify(form_result.__dict__)
elif (int(formid) == 2) :
form = DiagnoseForm1(request.form)
form_result = form.validate()
if form_result.status == rs.SUCCESS.status:
if form.diagnoseId is not None:
new_diagnose = Diagnose.getDiagnoseById(form.diagnoseId)
else:
new_diagnose = Diagnose.getNewDiagnoseByStatus(DiagnoseStatus.Draft, int(session['userId']))
if(new_diagnose is not None):
# 去拿没有draft的用户
if(form.exist):
new_patient = Patient.get_patient_by_id(form.patientid)
else:
new_patient = Patient.get_patient_draft(new_diagnose.patientId)
if new_patient is None:
new_patient = Patient()
new_patient.type = PatientStatus.diagnose
new_patient.userID = session['userId']
new_patient.realname = form.patientname
new_patient.gender = form.patientsex
new_patient.birthDate = datetime.strptime(form.birthdate, "%Y-%m-%d")
new_patient.identityCode = form.identitynumber
new_patient.locationId = form.locationId
new_patient.identityPhone = form.phonenumber
new_patient.status = ModelStatus.Draft
# new_patient.locationId = form.location
Patient.save(new_patient)
new_diagnose.patientId = new_patient.id
Diagnose.save(new_diagnose)
# Hospital User 注册用户
if(form.isHospitalUser):
new_user = User(form.phonenumber, random.sample('zyxwvutsrqponmlkjihgfedcba1234567890',6), False)
new_user.type = UserStatus.patent
new_user.status = ModelStatus.Draft
User.save(new_user)
new_patient.userID = new_user.id
Patient.save(new_patient)
new_userrole = UserRole(new_user.id, RoleId.Patient)
UserRole.save(new_userrole)
form_result.data = {'formId': 3, }
else:
form_result = ResultStatus(FAILURE.status, "找不到第一步草稿")
return jsonify(form_result.__dict__)
elif (int(formid) == 3):
form = DiagnoseForm2(request.form)
form_result = form.validate()
if form_result.status == rs.SUCCESS.status:
if form.diagnoseId is not None:
new_diagnose = Diagnose.getDiagnoseById(form.diagnoseId)
else:
new_diagnose = Diagnose.getNewDiagnoseByStatus(DiagnoseStatus.Draft, int(session['userId']))
if new_diagnose is not None:
if form.exist:
new_pathology = Pathology.getById(form.pathologyId)
elif new_diagnose.pathologyId:
new_pathology = Pathology.getById(new_diagnose.pathologyId)
else:
new_pathology = Pathology.getByPatientStatus(session['userId'], ModelStatus.Draft)
if new_pathology is None:
new_pathology = Pathology(new_diagnose.patientId)
new_pathology.diagnoseMethod = form.dicomtype
new_pathology.status = ModelStatus.Draft
new_pathology.save(new_pathology)
PathologyPostion.deleteByPathologyId(new_pathology.id)
for position in form.patientlocation:
new_position_id = PathologyPostion(new_pathology.id, position)
PathologyPostion.save(new_position_id)
File.cleanDirtyFile(form.fileurl, new_pathology.id, FileType.Dicom)
for fileurl in form.fileurl:
new_file = File.getFilebyId(int(fileurl))
new_file.pathologyId = new_pathology.id
File.save(new_file)
#.........这里部分代码省略.........