def get_e_appointment_evaluate(self, u_id): # 获取我参加的的已评价了的约拍 ret_e_appointment = [] ap_e_info = [] ap_e_entrys = self.db.query(AppointEntry).filter( AppointEntry.AEregisterID == u_id, AppointEntry.AEvalid == True, AppointEntry.AEchoosed == True).all() for ap_e_entry in ap_e_entrys: try: item = self.db.query(AppointmentInfo).filter( AppointmentInfo.AIappoid == ap_e_entry.AEapid).one() if item.AIpid == int(u_id): if AppointmentInfo.AIpcomment: ap_e_info = self.db.query(Appointment).filter( Appointment.APid == ap_e_entry.AEapid, ).all() ret_e_appointment.append( APmodelHandler.ap_Model_simply_one( ap_e_info[0], u_id)) if item.AImid == int(u_id): if AppointmentInfo.AImcomment: ap_e_info = self.db.query(Appointment).filter( Appointment.APid == ap_e_entry.AEapid, ).all() ret_e_appointment.append( APmodelHandler.ap_Model_simply_one( ap_e_info[0], u_id)) except Exception, e: print e
def get_e_appointment(self, u_id, number): ret_e_appointment = [] ap_e_info = [] if number == 0: ap_e_entrys = self.db.query(AppointEntry).filter( AppointEntry.AEregisterID == u_id, AppointEntry.AEvalid == True).all() else: ap_e_entrys = self.db.query(AppointEntry).filter( AppointEntry.AEregisterID == u_id, AppointEntry.AEvalid == True, AppointEntry.AEchoosed == True).all() if number == 2: for ap_e_entry in ap_e_entrys: ap_id = ap_e_entry.AEapid try: ap_e_info = self.db.query(Appointment).filter( Appointment.APid == ap_id, Appointment.APstatus >= number, Appointment.APstatus <= number + 1).all() except Exception, e: print e if ap_e_info: ret_e_appointment.append( APmodelHandler.ap_Model_simply_one(ap_e_info[0], u_id))
print e if ap_e_info: ret_e_appointment.append( APmodelHandler.ap_Model_simply_one(ap_e_info[0], u_id)) else: for ap_e_entry in ap_e_entrys: ap_id = ap_e_entry.AEapid try: ap_e_info = self.db.query(Appointment).filter( Appointment.APid == ap_id, Appointment.APstatus == number).all() except Exception, e: print e if ap_e_info: ret_e_appointment.append( APmodelHandler.ap_Model_simply_one(ap_e_info[0], u_id)) return ret_e_appointment def get_my_appointment(self, u_id, number): ap_my_entrys = [] ret_my_appointment = [] if number == 2: try: ap_my_entrys = self.db.query(Appointment).filter( Appointment.APsponsorid == u_id, Appointment.APstatus >= number, Appointment.APstatus <= number + 1).all() except Exception, e: print e ret_my_appointment = APmodelHandler.ap_Model_simply(