def __init__(self, *args, **kwargs): super(SourceAccessForm, self).__init__(*args, **kwargs) self.fields['sources'].choices = [ (c.name, c.name) for c in get_source_names(False, False, None) ] self.fields['role'].choices = [(c.name, c.name) for c in get_item_names(UserRole, True)] self.fields['organization'].choices = [ (c.name, c.name) for c in get_source_names(True, False, None) ]
def __init__(self, *args, **kwargs): super(SourceAccessForm, self).__init__(*args, **kwargs) self.fields['sources'].choices = [(c.name, c.name) for c in get_source_names(False, False, None)] self.fields['role'].choices = [(c.name, c.name) for c in get_item_names(UserRole, True)] self.fields['organization'].choices = [(c.name, c.name) for c in get_source_names(True, False, None)]
def __init__(self, username, *args, **kwargs): super(UploadFileForm, self).__init__(*args, **kwargs) self.fields['source'].choices = [(c.name, c.name) for c in get_source_names(True, True, username)] self.fields['source'].initial = get_user_organization(username) self.fields['campaign'].choices = [('', '')] + [ (c.name, c.name) for c in get_item_names(Campaign, True)] self.fields['confidence'].choices = [('', ''), ('low', 'low'), ('medium', 'medium'), ('high', 'high')] self.fields['backdoor'].choices = [('', '')] self.fields['relationship_type'].choices = relationship_choices self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO for (name, version) in get_backdoor_names(username): display = name value = name + '|||' + version if version: display += ' (Version: ' + version + ')' self.fields['backdoor'].choices.append((value, display)) add_bucketlist_to_form(self) add_ticket_to_form(self)
def __init__(self, username, *args, **kwargs): super(AddDomainForm, self).__init__(username, *args, **kwargs) self.fields['ip_source'].choices = [ (c.name, c.name) for c in get_source_names(True, True, username) ] self.fields['ip_source'].initial = get_user_organization(username) self.fields['ip_tlp'].choices = [ (t, t) for t in ('red', 'amber', 'green', 'white') ] self.fields['ip_tlp'].initial = 'red' if username.has_access_to(Common.CAMPAIGN_READ): self.fields['campaign'].choices = [('', '')] + [ (c.name, c.name) for c in get_item_names(Campaign, True) ] self.fields['confidence'].choices = [('', ''), ('low', 'low'), ('medium', 'medium'), ('high', 'high')] self.fields['ip_type'].choices = ip_choices self.fields['ip_type'].initial = IPTypes.IPV4_ADDRESS self.fields['relationship_type'].choices = relationship_choices self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO add_bucketlist_to_form(self) add_ticket_to_form(self)
def __init__(self, username, *args, **kwargs): super(UploadPcapForm, self).__init__(*args, **kwargs) self.fields["source"].choices = [(c.name, c.name) for c in get_source_names(True, True, username)] self.fields["source"].initial = get_user_organization(username) add_bucketlist_to_form(self) add_ticket_to_form(self)
def __init__(self, username, *args, **kwargs): super(UploadIndicatorCSVForm, self).__init__(*args, **kwargs) self.fields['source'].choices = [(c.name, c.name) for c in get_source_names(True, True, username)] self.fields['source'].initial = get_user_organization(username)
def __init__(self, username, *args, **kwargs): kwargs.setdefault('label_suffix', ':') super(UploadStandardsForm, self).__init__(*args, **kwargs) srcs = get_source_names(True, True, username) self.fields['source'].choices = [(c.name, c.name) for c in srcs] self.fields['source'].initial = get_user_organization(username)
def __init__(self, username, *args, **kwargs): kwargs.setdefault('label_suffix', ':') super(UploadStandardsForm, self).__init__(*args, **kwargs) self.fields['source'].choices = [ (c.name, c.name) for c in get_source_names(True, True, username) ] self.fields['source'].initial = get_user_organization(username)
def __init__(self, username, *args, **kwargs): super(UploadIndicatorTextForm, self).__init__(*args, **kwargs) self.fields['source'].choices = [ (c.name, c.name) for c in get_source_names(True, True, username)] self.fields['source'].initial = get_user_organization(username) dt = "Indicator, Type, Campaign, Campaign Confidence, Confidence, Impact, Bucket List, Ticket, Action\n" self.fields['data'].initial = dt
def __init__(self, username, *args, **kwargs): super(SourceForm, self).__init__(*args, **kwargs) self.fields['name'].choices = [(c.name, c.name) for c in get_source_names(True, True, username)] self.fields['name'].initial = get_user_organization(username)
def __init__(self, username, *args, **kwargs): super(UploadIndicatorTextForm, self).__init__(*args, **kwargs) self.fields['source'].choices = [ (c.name, c.name) for c in get_source_names(True, True, username)] self.fields['source'].initial = get_user_organization(username) dt = "Indicator, Type, Threat Type, Attack Type, Campaign, Campaign Confidence, Confidence, Impact, Bucket List, Ticket, Action, Status\n" self.fields['data'].initial = dt
def __init__(self, username, *args, **kwargs): super(AddActorIdentifierForm, self).__init__(*args, **kwargs) self.fields['identifier_type'].choices = [ (c.name, c.name) for c in get_item_names(ActorThreatIdentifier, True)] self.fields['source'].choices = [ (c.name, c.name) for c in get_source_names(True, True, username)] self.fields['source'].initial = get_user_organization(username)
def __init__(self, username, *args, **kwargs): super(SourceInForm, self).__init__(*args, **kwargs) self.fields['source_name'].choices = [ (c.name, c.name) for c in get_source_names(True, True, username)] self.fields['source_name'].initial = get_user_organization(username) self.fields['source_tlp'].choices = [ (t, t) for t in ('red', 'amber', 'green', 'white')] self.fields['source_tlp'].initial = 'red'
def __init__(self, username, *args, **kwargs): super(UploadRawDataFileForm, self).__init__(*args, **kwargs) self.fields["source"].choices = [(c.name, c.name) for c in get_source_names(True, True, username)] self.fields["source"].initial = get_user_organization(username) self.fields["data_type"].choices = [(c.name, c.name) for c in get_item_names(RawDataType, True)] add_bucketlist_to_form(self) add_ticket_to_form(self)
def __init__(self, username, *args, **kwargs): super(UploadIndicatorCSVForm, self).__init__(*args, **kwargs) self.fields['source'].choices = [ (c.name, c.name) for c in get_source_names(True, True, username) ] self.fields['source'].initial = get_user_organization(username) self.fields['relationship_type'].choices = relationship_choices self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO
def __init__(self, username, *args, **kwargs): super(UploadPcapForm, self).__init__(*args, **kwargs) self.fields['source'].choices = [(c.name, c.name) for c in get_source_names(True, True, username)] self.fields['source'].initial = get_user_organization(username) self.fields['relationship_type'].choices = relationship_choices self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO add_bucketlist_to_form(self) add_ticket_to_form(self)
def __init__(self, username, *args, **kwargs): super(UploadIndicatorTextForm, self).__init__(*args, **kwargs) self.fields['source'].choices = [ (c.name, c.name) for c in get_source_names(True, True, username)] self.fields['source'].initial = get_user_organization(username) dt = "Indicator, Type, Threat Type, Attack Type, Description, Campaign, Campaign Confidence, Confidence, Impact, Bucket List, Ticket, Action, Status\n" self.fields['data'].initial = dt self.fields['relationship_type'].choices = relationship_choices self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO
def __init__(self, username, *args, **kwargs): super(UploadPcapForm, self).__init__(*args, **kwargs) self.fields['source'].choices = [ (c.name, c.name) for c in get_source_names(True, True, username) ] self.fields['source'].initial = get_user_organization(username) add_bucketlist_to_form(self) add_ticket_to_form(self)
def __init__(self, username, *args, **kwargs): super(SourceInForm, self).__init__(*args, **kwargs) self.fields['source_name'].choices = [ (c.name, c.name) for c in get_source_names(True, True, username) ] self.fields['source_name'].initial = get_user_organization(username) self.fields['source_tlp'].choices = [ (t, t) for t in ('red', 'amber', 'green', 'white') ] self.fields['source_tlp'].initial = 'red'
def __init__(self, username, *args, **kwargs): super(AddObjectForm, self).__init__(*args, **kwargs) self.fields['object_type'].choices = [ (c, c) for c in ObjectTypes.values(sort=True) ] self.fields['object_type'].widget.attrs = {'class': 'object-types'} self.fields['source'].choices = [ (c.name, c.name) for c in get_source_names(True, True, username) ] self.fields['source'].initial = get_user_organization(username)
def __init__(self, username, *args, **kwargs): super(AddActorIdentifierForm, self).__init__(*args, **kwargs) self.fields['identifier_type'].choices = [ (c.name, c.name) for c in get_item_names(ActorThreatIdentifier, True) ] self.fields['source'].choices = [ (c.name, c.name) for c in get_source_names(True, True, username) ] self.fields['source'].initial = get_user_organization(username)
def __init__(self, username, *args, **kwargs): super(AddObjectForm, self).__init__(*args, **kwargs) self.fields['object_type'].choices = [ (c,c) for c in ObjectTypes.values(sort=True) ] self.fields['object_type'].widget.attrs = {'class':'object-types'} self.fields['source'].choices = [(c.name, c.name) for c in get_source_names(True, True, username)] self.fields['source'].initial = get_user_organization(username)
def __init__(self, username, *args, **kwargs): super(UploadRawDataFileForm, self).__init__(*args, **kwargs) self.fields['source'].choices = [ (c.name, c.name) for c in get_source_names(True, True, username) ] self.fields['source'].initial = get_user_organization(username) self.fields['data_type'].choices = [ (c.name, c.name) for c in get_item_names(RawDataType, True) ] add_bucketlist_to_form(self) add_ticket_to_form(self)
def __init__(self, username, *args, **kwargs): super(EventForm, self).__init__(*args, **kwargs) self.fields['source'].choices = [(c.name, c.name) for c in get_source_names(True, True, username)] self.fields['source'].initial = get_user_organization(username) self.fields['event_type'].choices = [ (c,c) for c in EventTypes.values(sort=True) ] add_bucketlist_to_form(self) add_ticket_to_form(self)
def __init__(self, username, *args, **kwargs): kwargs.setdefault('label_suffix', ':') super(TAXIIFeedConfigForm, self).__init__(*args, **kwargs) srcs = get_source_names(True, True, username) self.fields['source'].choices = [(c.name, c.name) for c in srcs] self.fields['source'].initial = get_user_organization(username) ind_ci = IndicatorCI.values() self.fields['def_conf'].choices = [(c, c.title()) for c in ind_ci] self.fields['def_conf'].initial = 'unknown' self.fields['def_impact'].choices = [(c, c.title()) for c in ind_ci] self.fields['def_impact'].initial = 'unknown'
def __init__(self, username, *args, **kwargs): super(EventForm, self).__init__(*args, **kwargs) self.fields['source'].choices = [(c.name, c.name) for c in get_source_names(True, True, username)] self.fields['source'].initial = get_user_organization(username) self.fields['event_type'].choices = [(c.name, c.name) for c in get_item_names(EventType, True)] add_bucketlist_to_form(self) add_ticket_to_form(self)
def __init__(self, username, *args, **kwargs): super(EmailYAMLForm, self).__init__(*args, **kwargs) self.fields['source'].choices = [ (c.name, c.name) for c in get_source_names(True, True, username) ] self.fields['source'].initial = get_user_organization(username) self.fields['campaign'].choices = [("", "")] self.fields['campaign'].choices += [ (c.name, c.name) for c in get_item_names(Campaign, True) ] self.fields['campaign_confidence'].choices = [("", ""), ("low", "low"), ("medium", "medium"), ("high", "high")]
def __init__(self, username, choices, *args, **kwargs): super(AddObjectForm, self).__init__(*args, **kwargs) if not choices: choices = [(c[0], c[0], {'datatype':c[1].keys()[0], 'datatype_value':c[1].values()[0]}) for c in get_object_types(True)] self.fields['object_type'].choices = choices self.fields['object_type'].widget.attrs = {'class':'object-types'} self.fields['source'].choices = [(c.name, c.name) for c in get_source_names(True, True, username)] self.fields['source'].initial = get_user_organization(username)
def __init__(self, username, *args, **kwargs): super(EmailOutlookForm, self).__init__(*args, **kwargs) self.fields['source'].choices = [(c.name, c.name) for c in get_source_names(True, True, username)] self.fields['source'].initial = get_user_organization(username) self.fields['campaign'].choices = [("","")] self.fields['campaign'].choices += [(c.name, c.name ) for c in get_item_names(Campaign, True)] self.fields['campaign_confidence'].choices = [("", ""), ("low", "low"), ("medium", "medium"), ("high", "high")]
def __init__(self, username, *args, **kwargs): super(UploadSignatureForm, self).__init__(*args, **kwargs) self.fields['source'].choices = [ (c.name, c.name) for c in get_source_names(True, True, username) ] self.fields['source'].initial = get_user_organization(username) self.fields['data_type'].choices = [ (c.name, c.name) for c in get_item_names(SignatureType, True) ] self.fields['relationship_type'].choices = relationship_choices self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO add_bucketlist_to_form(self) add_ticket_to_form(self)
def __init__(self, username, *args, **kwargs): super(AddActorForm, self).__init__(*args, **kwargs) self.fields['campaign'].choices = [('', '')] + [ (c.name, c.name) for c in get_item_names(Campaign, True)] self.fields['confidence'].choices = [('', ''), ('low', 'low'), ('medium', 'medium'), ('high', 'high')] self.fields['source'].choices = [(c.name, c.name) for c in get_source_names(True, True, username)] self.fields['source'].initial = get_user_organization(username) add_bucketlist_to_form(self) add_ticket_to_form(self)
def __init__(self, username, *args, **kwargs): super(EmailAttachForm, self).__init__(*args, **kwargs) self.fields['campaign'].choices = [('', '')] + [ (c.name, c.name) for c in get_item_names(Campaign, True)] self.fields['confidence'].choices = [('', ''), ('low', 'low'), ('medium', 'medium'), ('high', 'high')] self.fields['source'].choices = [(c.name, c.name) for c in get_source_names(True, True, username)] self.fields['source'].initial = get_user_organization(username) self.fields['source_date'].value = datetime.now() add_bucketlist_to_form(self) add_ticket_to_form(self)
def __init__(self, username, choices, *args, **kwargs): super(AddIPForm, self).__init__(*args, **kwargs) if choices is None: self.fields["ip_type"].choices = ip_choices else: self.fields["ip_type"].choices = choices self.fields["campaign"].choices = [("", "")] + [(c.name, c.name) for c in get_item_names(Campaign, True)] self.fields["confidence"].choices = [("", ""), ("low", "low"), ("medium", "medium"), ("high", "high")] self.fields["source"].choices = [(c.name, c.name) for c in get_source_names(True, True, username)] self.fields["source"].initial = get_user_organization(username) self.fields["analyst"].initial = username add_bucketlist_to_form(self) add_ticket_to_form(self)
def __init__(self, username, *args, **kwargs): super(EmailYAMLForm, self).__init__(*args, **kwargs) self.fields['source'].choices = [ (c.name, c.name) for c in get_source_names(True, True, username) ] self.fields['source'].initial = get_user_organization(username) self.fields['campaign'].choices = [("", "")] self.fields['campaign'].choices += [ (c.name, c.name) for c in get_item_names(Campaign, True) ] self.fields['campaign_confidence'].choices = [("", ""), ("low", "low"), ("medium", "medium"), ("high", "high")] self.fields['relationship_type'].choices = relationship_choices self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO add_bucketlist_to_form(self) add_ticket_to_form(self)
def __init__(self, username, *args, **kwargs): super(EmailYAMLForm, self).__init__(*args, **kwargs) self.fields['source'].choices = [(c.name, c.name) for c in get_source_names(True, True, username)] self.fields['source'].initial = get_user_organization(username) self.fields['campaign'].choices = [("","")] self.fields['campaign'].choices += [(c.name, c.name ) for c in get_item_names(Campaign, True)] self.fields['campaign_confidence'].choices = [("", ""), ("low", "low"), ("medium", "medium"), ("high", "high")] self.fields['relationship_type'].choices = relationship_choices self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO add_bucketlist_to_form(self) add_ticket_to_form(self)
def __init__(self, username, *args, **kwargs): super(UploadIndicatorForm, self).__init__(*args, **kwargs) self.fields['source'].choices = [ (c.name, c.name) for c in get_source_names(True, True, username)] self.fields['source'].initial = get_user_organization(username) self.fields['status'].choices = [ (c,c) for c in Status.values() ] self.fields['indicator_type'].choices = [ (c,c) for c in IndicatorTypes.values(sort=True) ] self.fields['threat_type'].choices = [ (c,c) for c in IndicatorThreatTypes.values(sort=True) ] self.fields['threat_type'].initial = IndicatorThreatTypes.UNKNOWN self.fields['attack_type'].choices = [ (c,c) for c in IndicatorAttackTypes.values(sort=True) ] self.fields['attack_type'].initial = IndicatorAttackTypes.UNKNOWN self.fields['indicator_type'].widget.attrs = {'class': 'object-types'} self.fields['campaign'].choices = [("", "")] self.fields['campaign'].choices += [ (c.name, c.name) for c in get_item_names(Campaign, True)] self.fields['campaign_confidence'].choices = [ ("", ""), ("low", "low"), ("medium", "medium"), ("high", "high")] self.fields['confidence'].choices = [ ("unknown", "unknown"), ("benign", "benign"), ("low", "low"), ("medium", "medium"), ("high", "high")] self.fields['impact'].choices = [ ("unknown", "unknown"), ("benign", "benign"), ("low", "low"), ("medium", "medium"), ("high", "high")] self.fields['relationship_type'].choices = relationship_choices self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO add_bucketlist_to_form(self) add_ticket_to_form(self)
def __init__(self, username, *args, **kwargs): super(AddBackdoorForm, self).__init__(*args, **kwargs) self.fields['campaign'].choices = [('', '')] + [ (c.name, c.name) for c in get_item_names(Campaign, True)] self.fields['confidence'].choices = [ ('', ''), ('low', 'low'), ('medium', 'medium'), ('high', 'high')] self.fields['source'].choices = [ (c.name, c.name) for c in get_source_names(True, True, username)] self.fields['source'].initial = get_user_organization(username) self.fields['relationship_type'].choices = relationship_choices self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO add_bucketlist_to_form(self) add_ticket_to_form(self)
def __init__(self, username, choices=None, *args, **kwargs): super(UploadIndicatorForm, self).__init__(*args, **kwargs) self.fields['source'].choices = [ (c.name, c.name) for c in get_source_names(True, True, username) ] self.fields['source'].initial = get_user_organization(username) if not choices: #only valid types for indicators are those which don't require file upload choices = [(c[0], c[0], { 'datatype': c[1].keys()[0], 'datatype_value': c[1].values()[0] }) for c in get_object_types(active=True, query={ 'datatype.file': { '$exists': 0 }, 'datatype.enum': { '$exists': 0 } })] self.fields['indicator_type'].choices = choices self.fields['indicator_type'].widget.attrs = {'class': 'object-types'} self.fields['campaign'].choices = [("", "")] self.fields['campaign'].choices += [ (c.name, c.name) for c in get_item_names(Campaign, True) ] self.fields['campaign_confidence'].choices = [("", ""), ("low", "low"), ("medium", "medium"), ("high", "high")] self.fields['confidence'].choices = [("unknown", "unknown"), ("benign", "benign"), ("low", "low"), ("medium", "medium"), ("high", "high")] self.fields['impact'].choices = [("unknown", "unknown"), ("benign", "benign"), ("low", "low"), ("medium", "medium"), ("high", "high")] add_bucketlist_to_form(self) add_ticket_to_form(self)
def __init__(self, username, choices, *args, **kwargs): super(AddIPForm, self).__init__(*args, **kwargs) if choices is None: self.fields['ip_type'].choices = ip_choices else: self.fields['ip_type'].choices = choices self.fields['campaign'].choices = [('', '')] + [ (c.name, c.name) for c in get_item_names(Campaign, True)] self.fields['confidence'].choices = [('', ''), ('low', 'low'), ('medium', 'medium'), ('high', 'high')] self.fields['source'].choices = [(c.name, c.name) for c in get_source_names(True, True, username)] self.fields['source'].initial = get_user_organization(username) self.fields['analyst'].initial = username add_bucketlist_to_form(self) add_ticket_to_form(self)
def __init__(self, username, *args, **kwargs): super(UploadIndicatorForm, self).__init__(*args, **kwargs) self.fields['source'].choices = [ (c.name, c.name) for c in get_source_names(True, True, username) ] self.fields['source'].initial = get_user_organization(username) self.fields['status'].choices = [(c, c) for c in Status.values()] self.fields['indicator_type'].choices = [ (c, c) for c in IndicatorTypes.values(sort=True) ] self.fields['threat_type'].choices = [ (c, c) for c in IndicatorThreatTypes.values(sort=True) ] self.fields['threat_type'].initial = IndicatorThreatTypes.UNKNOWN self.fields['attack_type'].choices = [ (c, c) for c in IndicatorAttackTypes.values(sort=True) ] self.fields['attack_type'].initial = IndicatorAttackTypes.UNKNOWN self.fields['indicator_type'].widget.attrs = {'class': 'object-types'} self.fields['campaign'].choices = [("", "")] self.fields['campaign'].choices += [ (c.name, c.name) for c in get_item_names(Campaign, True) ] self.fields['campaign_confidence'].choices = [("", ""), ("low", "low"), ("medium", "medium"), ("high", "high")] self.fields['confidence'].choices = [("unknown", "unknown"), ("benign", "benign"), ("low", "low"), ("medium", "medium"), ("high", "high")] self.fields['impact'].choices = [("unknown", "unknown"), ("benign", "benign"), ("low", "low"), ("medium", "medium"), ("high", "high")] self.fields['relationship_type'].choices = relationship_choices self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO add_bucketlist_to_form(self) add_ticket_to_form(self)
def __init__(self, username, choices=None, *args, **kwargs): super(UploadIndicatorForm, self).__init__(*args, **kwargs) self.fields['source'].choices = [(c.name, c.name) for c in get_source_names(True, True, username)] self.fields['source'].initial = get_user_organization(username) if not choices: #only valid types for indicators are those which don't require file upload choices = [(c[0], c[0], {'datatype':c[1].keys()[0], 'datatype_value':c[1].values()[0]} ) for c in get_object_types(active=True, query={'datatype.file':{'$exists':0}})] self.fields['indicator_type'].choices = choices self.fields['indicator_type'].widget.attrs = {'class':'object-types'} self.fields['campaign'].choices = [("","")] self.fields['campaign'].choices += [(c.name, c.name ) for c in get_item_names(Campaign, True)] self.fields['campaign_confidence'].choices = [("", ""), ("low", "low"), ("medium", "medium"), ("high", "high")] self.fields['confidence'].choices = [("unknown", "unknown"), ("benign", "benign"), ("low", "low"), ("medium", "medium"), ("high", "high")] self.fields['impact'].choices = [("unknown", "unknown"), ("benign", "benign"), ("low", "low"), ("medium", "medium"), ("high", "high")] add_bucketlist_to_form(self) add_ticket_to_form(self)
def __init__(self, username, *args, **kwargs): super(AddDomainForm, self).__init__(*args, **kwargs) self.fields['domain_source'].choices = self.fields[ 'ip_source'].choices = [ (c.name, c.name) for c in get_source_names(True, True, username) ] self.fields['domain_source'].initial = get_user_organization(username) self.fields['ip_source'].initial = get_user_organization(username) self.fields['campaign'].choices = [('', '')] + [ (c.name, c.name) for c in get_item_names(Campaign, True) ] self.fields['confidence'].choices = [('', ''), ('low', 'low'), ('medium', 'medium'), ('high', 'high')] self.fields['ip_type'].choices = ip_choices self.fields['ip_type'].initial = IPTypes.IPV4_ADDRESS self.fields['relationship_type'].choices = relationship_choices self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO add_bucketlist_to_form(self) add_ticket_to_form(self)
def __init__(self, username, *args, **kwargs): super(AddReleasabilityForm, self).__init__(*args, **kwargs) self.fields['source'].choices = [(c.name, c.name) for c in get_source_names(True, True, username)]
def __init__(self, *args, **kwargs): super(RoleSourceEdit, self).__init__(*args, **kwargs) self.fields['sources'].choices = [(c.name, c.name) for c in get_source_names(False, False, None)]
def __init__(self, username, *args, **kwargs): super(SourceForm, self).__init__(*args, **kwargs) self.fields["name"].choices = [(c.name, c.name) for c in get_source_names(True, True, username)] self.fields["name"].initial = get_user_organization(username)
def __init__(self, username, *args, **kwargs): super(AddDomainForm, self).__init__(*args, **kwargs) self.fields['domain_source'].choices = self.fields['ip_source'].choices = [(c.name, c.name) for c in get_source_names(True, True, username)] self.fields['domain_source'].initial = get_user_organization(username) self.fields['ip_source'].initial = get_user_organization(username) self.fields['campaign'].choices = [('', '')] + [(c.name, c.name) for c in get_item_names(Campaign, True)] self.fields['confidence'].choices = [('',''), ('low', 'low'), ('medium', 'medium'), ('high', 'high')] self.fields['ip_type'].choices = ip_choices self.fields['ip_type'].initial = "Address - ipv4-addr" add_bucketlist_to_form(self) add_ticket_to_form(self)
def __init__(self, *args, **kwargs): super(RoleSourceEdit, self).__init__(*args, **kwargs) self.fields['sources'].choices = [ (c.name, c.name) for c in get_source_names(False, False, None) ]