def search_automobiledevice_byname(automobiledevicename): result = None try: result = DAL_AutoMobileDevice.get_all().filter( AName__icontains=automobiledevicename) except Exception as ex: print(ex) return result
def search_automobiledevice_byid(automobiledeviceid): automobiledevice = None try: automobiledevice = DAL_AutoMobileDevice.get_all().filter( id=automobiledeviceid) except Exception as ex: SimpleLogger.error(ex.message) return automobiledevice
def search_automobiledevice(searchkeyword): if searchkeyword == "ALL": result = DAL_AutoMobileDevice.get_all().filter(MDIsActive=1) else: result = AutoMobileDeviceService.search_automobiledevice_byid( searchkeyword) if result == None or len(result) == 0: result = AutoMobileDeviceService.search_automobiledevice_byname( searchkeyword.strip()) return result.order_by("-id")
def get_automobiledevice_namelist(): automobiledevicelist = DAL_AutoMobileDevice.get_all() return str([item.TaskName for item in automobiledevicelist]).replace("u'", "'")