def __generate_data__(self): self.result_dict[KEY_ENVIRONMENT] = EnvironmentBuilder( environment=self.environment).get_data() self.result_dict[KEY_COUNTRY] = CountryBuilder(self.country).get_data() self.result_dict[KEY_RULESET_NAME] = self.ruleset_name self.result_dict[KEY_RULESET_DATA] = self.ruleset_list self.result_dict[KEY_RULESET_PATH_INFO] = self.ruleset_path_info
def __generate_data__(self): self.result_dict[KEY_TARGET_ENV] = EnvironmentBuilder( environment=self.target_env).get_data() self.result_dict[KEY_COUNTRY] = CountryBuilder(self.country).get_data() self.result_dict[KEY_UPDATED_TIME] = self.get_current_time() self.result_dict[KEY_FAILED_RULESETS] = self.failed_rulesets_list self.result_dict[KEY_CREATED_RULESETS] = self.created_ruleset_list self.result_dict[KEY_UPDATED_RULESETS] = self.updated_ruleset_list self.result_dict[KEY_DELETED_RULESETS] = self.deleted_ruleset_list
def get_countries(self): country_data_list = [] enable_country_ids = enable_environments_countries( self.user.id, self.enable_environment_ids) countries = RulesetLogGroup.objects.filter( log_count__gt=0, country_id__in=enable_country_ids).values_list( "country").distinct() for country_obj in countries: country = Country.objects.get(id=country_obj[0]) country_data = CountryBuilder(country).get_data() country_data_list.append(country_data) return country_data_list
def generate_git_country_path_data(self): data_list = [] for git_country_path in self.git_country_paths: module = Module.objects.get(id=git_country_path.get("module_id")) country = Country.objects.get( id=git_country_path.get("country_id")) data_object = { KEY_ID: git_country_path.get("id"), KEY_MODULE_DATA: ModuleBuilder(module).get_data(), KEY_COUNTRY: CountryBuilder(country).get_data(), KEY_REPO_PATH: git_country_path.get("repo_path"), KEY_FOLDER: git_country_path.get("folder") } data_list.append(data_object) return data_list
def __generate_data__(self): self.result_dict[KEY_COUNTRY] = CountryBuilder(self.country).get_data() self.result_dict[KEY_ENVIRONMENT] = EnvironmentBuilder( environment=self.environment).get_data() self.result_dict[RULE_NAME_LIST] = array_filter( self.ruleset_name_list, self.filter_keys)
def parse_country(country_id): country = Country.objects.get(id=country_id) return CountryBuilder(country).get_data()
def get_country_list(self): country_list = [] for country in self.scheduler.country_list.all(): country_data = CountryBuilder(country).get_data() country_list.append(country_data) return country_list
def __generate_data__(self): self.result_dict[KEY_COUNTRY] = CountryBuilder(self.skip_ruleset_model.country).get_data() self.result_dict[KEY_RULESET_LIST] = parse_db_string_list(self.skip_ruleset_model.ruleset_list)
def parse_country(self): country_list = [] for country in self.countries: country_data = CountryBuilder(country).get_data() country_list.append(country_data) return country_list