Esempio n. 1
0
 def __generate_data__(self):
     self.result_dict[SOURCE_ENVIRONMENT] = EnvironmentsBuilder(
         ids=self.sync_from_environments).get_data()
     self.result_dict[TARGET_ENVIRONMENT] = EnvironmentsBuilder(
         ids=self.sync_to_environments).get_data()
     self.result_dict[ENVIRONMENT_SELECT_COUNTRY] = CountriesBuilder(
         countries=self.countries).get_data()
     self.result_dict[ACTION_LIST] = self.action_list
     self.result_dict[KEY_FREQUENCY_TYPES] = FrequencyTypesBuilder(
         FrequencyType.objects.all()).get_data()
     self.result_dict[SCHEDULER_DATA] = RulesetSyncSchedulerBuilder(
         None, self.scheduler).get_data()
Esempio n. 2
0
def get_region_environment_list(json_data):
    parser = SelectToCompareFilterEnvironmentParser(json_data)
    environment_list = FTPServer.objects.filter(region__id=parser.region_id, environment__active=1).values_list(
        "environment_id", flat=True)
    environments_json = EnvironmentsBuilder(ids=environment_list).get_data()
    result_json = SelectToCompareFilterEnvironmentBuilder(parser.side, environments_json).get_data()
    return result_json
def get_region_environment_list(json_data):
    try:
        parser = SelectToDownloadFilterEnvironmentParser(json_data)
        environment_list = FTPServer.objects.filter(
            region__id=parser.region_id,
            environment__active=1).values_list("environment_id", flat=True)
        environments_json = EnvironmentsBuilder(
            ids=environment_list).get_data()
        result_json = SelectToDownloadFilterEnvironmentBuilder(
            environments_json).get_data()
        return result_json
    except Exception as e:
        raise e
    def after_check():
        countries = Country.objects.all()
        environments = Environment.objects.filter(active=1)

        response = {
            key.ENVIRONMENT_SELECT_COUNTRY:
            CountriesBuilder(countries=countries).get_data(),
            key.ENVIRONMENT_SELECT_ENVIRONMENT:
            EnvironmentsBuilder(environments=environments).get_data()
        }

        if request.method == REQUEST_GET:
            return render(request, "environment_select.html", response)
        elif request.method == REQUEST_POST:
            country_id = request.POST.get('country')
            base_env_id = request.POST.get('base_env')
            compare_env_id = request.POST.get('compare_env')

            if not country_id or not base_env_id or not compare_env_id or base_env_id == compare_env_id:
                return render(request, "environment_select.html", response)
            else:
                data = services.compare_rule_list_rule_set(
                    base_env_id, compare_env_id, country_id)
                return render(request, "rule_item_list.html", data)
Esempio n. 5
0
 def __generate_data__(self):
     self.result_dict[KEY_ENVIRONMENTS] = EnvironmentsBuilder(
         ids=self.environment_ids).get_data()
def enable_environments_data(user_id, function_key, module_key):
    enable_environment_ids = enable_environments(user_id, function_key,
                                                 module_key)
    environment_data = EnvironmentsBuilder(
        ids=enable_environment_ids).get_data()
    return environment_data
Esempio n. 7
0
 def __generate_data__(self):
     self.result_dict[SOURCE_ENVIRONMENT] = EnvironmentsBuilder(ids=self.sync_from_environments).get_data()
     self.result_dict[TARGET_ENVIRONMENT] = EnvironmentsBuilder(ids=self.sync_to_environments).get_data()
     self.result_dict[ENVIRONMENT_SELECT_COUNTRY] = CountriesBuilder(countries=self.countries).get_data()
     self.result_dict[KEY_FREQUENCY_TYPES] = FrequencyTypesBuilder(self.frequency_types).get_data()
     self.result_dict[ACTION_LIST] = self.action_list