def attr_type_value(key): k, v = utils.find_element_by_key_in_tuples(key, Constants.ATTRIBUTE_TYPE) if v is None: logger.info( f"attr_type_value : Could not found value for key \"{key}\"") return key return _(v)
def category_page_title(key): k, v = utils.find_element_by_key_in_tuples(key, Constants.CATEGORIES) if v is None: logger.info( f"category_page_title : Could not found value for key \"{key}\"") return key return v
def pay_status_value(key): k, v = utils.find_element_by_key_in_tuples(key, Constants.PAYMENT_STATUS) if v is None: logger.info( f"pay_status_value: Could not found value for key \"{key}\"") return key return v
def refund_declined_value(key): k, v = utils.find_element_by_key_in_tuples( key, Constants.REFUND_DECLINED_REASON) if v is None: logger.info( f"refund_declined_value: Could not found value for key \"{key}\"") return key return v
def pay_mode_value(key): k, v = utils.find_element_by_key_in_tuples(key, Constants.ORDER_PAYMENT_MODE) if v is None: logger.info( f"pay_mode_value: Could not found value for key \"{key}\"") return key return v
def set_address_type(address, address_type): if not isinstance(address, Address): return False if not isinstance(address_type, int): return False k, v = utils.find_element_by_key_in_tuples( address_type, Addressbook_Constants.ADDRESS_TYPES) if v is None: return False Address.objects.filter(pk=address.pk).update(address_type=address_type) return True
def get_payment_option_name(option=None): key, value = utils.find_element_by_key_in_tuples(option, ORDER_PAYMENT_OPTIONS) return key, value
def get_order_status_name(order_status=None): key, value = utils.find_element_by_key_in_tuples(order_status, ORDER_STATUS) return key, value
def address_type_value(key): k,v = utils.find_element_by_key_in_tuples(key, Constants.ADDRESS_TYPES) if v is None: logger.info(f"address_type_value : Could not found value for key \"{key}\"") return key return v
def get_gender_value(key): return utils.find_element_by_key_in_tuples(key, GENDER)
def get_payment_date_value(key): k, v = utils.find_element_by_key_in_tuples(key, PAYMENT_DATE) return k, v
def get_payment_mode_value(key): k, v = utils.find_element_by_key_in_tuples(key, PAYMENT_MODE) return k, v
def get_payment_status_value(key): k, v = utils.find_element_by_key_in_tuples(key, PAYMENT_STATUS) return k, v
def get_declined_reason_value(key): k, v = utils.find_element_by_key_in_tuples(key, DECLINED_REASON) return k, v
def ship_mode_value(key): k,v = utils.find_element_by_key_in_tuples(key, Constants.SHIP_MODE) if v is None: logger.info(f"ship_mode_value : Could not found value for key \"{key}\"") return key return v
def get_category_page_title(key): return utils.find_element_by_key_in_tuples(key, CATEGORIES)
def account_type_value(key): k,v = utils.find_element_by_key_in_tuples(key, ACCOUNT_CONSTANTS.ACCOUNT_TYPE) if v is None: logger.info(f"account_type_value: Could not found value for key \"{key}\"") return key return v
def get_attribute_type_value(key): return utils.find_element_by_key_in_tuples(key, ATTRIBUTE_TYPE)