コード例 #1
0
ファイル: forms.py プロジェクト: StamusNetworks/scirius
 def __init__(self, *args, **kwargs):
     super(RulesetForm, self).__init__(*args, **kwargs)
     sourceatversion = SourceAtVersion.objects.all()
     self.fields['sources'].queryset = sourceatversion
     self.fields['action'].choices = Ruleset.get_transformation_choices(key=Transformation.ACTION)
     self.fields['lateral'].choices = Ruleset.get_transformation_choices(key=Transformation.LATERAL)
     self.fields['target'].choices = Ruleset.get_transformation_choices(key=Transformation.TARGET)
コード例 #2
0
 def __init__(self, *args, **kwargs):
     super(RulesetForm, self).__init__(*args, **kwargs)
     sourceatversion = SourceAtVersion.objects.all()
     self.fields['sources'].queryset = sourceatversion
     self.fields['action'].choices = Ruleset.get_transformation_choices(key=Transformation.ACTION)
     self.fields['lateral'].choices = Ruleset.get_transformation_choices(key=Transformation.LATERAL)
     self.fields['target'].choices = Ruleset.get_transformation_choices(key=Transformation.TARGET)
コード例 #3
0
ファイル: forms.py プロジェクト: raimundojimenez/scirius
 def __init__(self, *args, **kwargs):
     super(RulesetEditForm, self).__init__(*args, **kwargs)
     self.fields['action'].choices = Ruleset.get_transformation_choices(
         key=Transformation.ACTION)
     self.fields['lateral'].choices = Ruleset.get_transformation_choices(
         key=Transformation.LATERAL)
     self.fields['target'].choices = Ruleset.get_transformation_choices(
         key=Transformation.TARGET)
コード例 #4
0
    def __init__(self, *args, **kwargs):
        super(RulesetForm, self).__init__(*args, **kwargs)

        from scirius.utils import get_middleware_module
        sourceatversion = SourceAtVersion.objects.exclude(
            source__datatype__in=get_middleware_module(
                'common').custom_source_datatype(True))
        self.fields['sources'].queryset = sourceatversion
        self.fields['action'].choices = Ruleset.get_transformation_choices(
            key=Transformation.ACTION)
        self.fields['lateral'].choices = Ruleset.get_transformation_choices(
            key=Transformation.LATERAL)
        self.fields['target'].choices = Ruleset.get_transformation_choices(
            key=Transformation.TARGET)
コード例 #5
0
ファイル: forms.py プロジェクト: StamusNetworks/scirius
 def __init__(self, *args, **kwargs):
     super(RulesetEditForm, self).__init__(*args, **kwargs)
     self.fields['action'].choices = Ruleset.get_transformation_choices(key=Transformation.ACTION)
     self.fields['lateral'].choices = Ruleset.get_transformation_choices(key=Transformation.LATERAL)
     self.fields['target'].choices = Ruleset.get_transformation_choices(key=Transformation.TARGET)