(self, obj)
return query
Abstract the query type from the call.
Abstract the query type from the call.
Abstract the query type from the call .
def _get_query_type(self, obj):
        """Abstract the query type from the call."""
        if obj._meta['crits_type'] == 'Domain':
            query = obj.domain
        elif obj._meta['crits_type'] == 'IP':
            query = obj.ip
        elif obj._meta['crits_type'] == 'Indicator':
            query = obj.value
        elif obj._meta['crits_type'] == 'Email':
            query = list()
            for field in ['sender', 'to', 'from_address']:
                tmp = getattr(obj, field)
                if not tmp or tmp == '':
                    continue
                query.append(tmp)
        self._info("Query value passed along: %s." % str(query))
        return query
def _get_query_type ( self , obj ) : if obj . _meta [ 'crits_type' ] == 'Domain' : query = obj . domain elif obj . _meta [ 'crits_type' ] == 'IP' : query = obj . ip elif obj . _meta [ 'crits_type' ] == 'Indicator' : query = obj . value elif obj . _meta [ 'crits_type' ] == 'Email' : query = list ( ) for field in [ 'sender' , 'to' , 'from_address' ] : tmp = getattr ( obj , field ) if not tmp or tmp == '' : continue query . append ( tmp ) self . _info ( "Query value passed along: %s." % str ( query ) ) return query