How to use the threatexchange.forms.ThreatExchangeConfigForm function in threatexchange

To help you get started, we’ve selected a few threatexchange examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github crits / crits_services / threatexchange / forms.py View on Github external
def __init__(self, *args, **kwargs):
        kwargs.setdefault('label_suffix', ':')
        super(ThreatExchangeConfigForm, self).__init__(*args, **kwargs)
github crits / crits_services / threatexchange / __init__.py View on Github external
def generate_config_form(self, config):
        html = render_to_string('services_config_form.html',
                                {'name': self.name,
                                 'form': forms.ThreatExchangeConfigForm(
                                     initial=config),
                                 'config_error': None})
        form = forms.ThreatExchangeConfigForm
        return form, html
github crits / crits_services / threatexchange / __init__.py View on Github external
def get_config_details(config):
        display_config = {}

        # Rename keys so they render nice.
        fields = forms.ThreatExchangeConfigForm().fields
        for name, field in fields.iteritems():
            display_config[field.label] = config[name]

        return display_config