Example #1
0
    def fill_missing_state_data(self):
        """Fills in blank US state names or codes from its counterpart"""

        if self.state_code and self.state_name:
            return
        if self.country_name == 'UNITED STATES':
            if (not self.state_code):
                self.state_code = state_to_code.get(self.state_name)
            elif (not self.state_name):
                self.state_name = code_to_state.get(self.state_code)
    def fill_missing_state_data(self):
        """Fills in blank US state names or codes from its counterpart"""

        if self.state_code and self.state_name:
            return
        if self.country_name == "UNITED STATES":
            if not self.state_code:
                self.state_code = state_to_code.get(self.state_name)
            elif not self.state_name:
                state_obj = code_to_state.get(self.state_code)

                if state_obj:
                    self.state_name = state_obj["name"]
    def fill_missing_state_data(self):
        """Fills in blank US state names or codes from its counterpart"""

        if self.state_code and self.state_name:
            return
        if self.country_name == 'UNITED STATES':
            if not self.state_code:
                self.state_code = state_to_code.get(self.state_name)
            elif not self.state_name:
                state_obj = code_to_state.get(self.state_code)

                if state_obj:
                    self.state_name = state_obj['name']
Example #4
0
def place_of_performance_state_code(broker_input):
    if broker_input["place_of_performance_state"]:
        return capitalize_if_string(broker_input["place_of_performance_state"])
    elif broker_input["place_of_perfor_state_desc"]:
        return state_to_code.get(broker_input["place_of_perfor_state_desc"])
    return None