def __handleInsertPenalty(self): insertType = self.Request.REQUEST.get('type', '') penalty_para = self.__getPenaltyDictionaryData() if (insertType == 'user'): userPanaltyVO = proxy.px_UserPenalty().createUserPenaltyObject( penalty_para) if not proxy.px_UserPenalty().insert_model_object(userPanaltyVO): raise exception.AppDbValidationError('db insert error') elif (insertType == 'admin'): adminPanaltyVO = proxy.px_AdminPenalty().createAdminPenaltyObject( penalty_para) if not proxy.px_AdminPenalty().insert_model_object(adminPanaltyVO): raise exception.AppDbValidationError('db insert error') else: raise exception.AppValidationError('null allow this type')
def getUserPenaltyById(id): return proxy.px_UserPenalty().getUserPenaltyById(id)
def getUserPenaltyList(): return proxy.px_UserPenalty().getUserPenaltyList()