def init(cls): result = const.RESPONSE_RESULT_FAILED try: CategoryLogic.init() except Exception, ex: logging.error(ex.message) message = const.MESSAGE_FAILED
def list(cls): result = const.RESPONSE_RESULT_FAILED res = None try: res = CategoryLogic.list() except Exception, ex: logging.error(ex.message) message = const.MESSAGE_FAILED
def init(self): categories = CategoryLogic.list().get("items") self.category_id.choices = [ (category.get("category_id"), category.get("category_name")) for category in categories]