# scanners.ScannerResult
## Model Info
| Key | Value |
|---|-----|
| Model Name | ScannerResult |
| Verbose Name | scanner result |
| Verbose Name Plural | scanner results |
| Docstring |
ScannerResult(id, created, modified, results, scanner, version, upload, score, model\_version, has\_matches, state)
|
| Is Abstract | False |
| Is Proxy | False |
| Is Managed | True |
| Ordering | [] |
| Permissions | [] |
| Default Permissions | ('add', 'change', 'delete', 'view') |
| Indexes | [, ] |
| Constraints | [] |
| Database Table | scanners_results |
| Base Manager | objects |
| Default Manager | None |
| File | /data/olympia/src/olympia/scanners/models.py |
| Starting Line Number | 246 |
| Method Resolution Order | (, , , , , , ) |
## Fields
| Field Name | Field Type | Database Column | Database Type | Verbose Name |
|----------|----------|---------------|-------------|------------|
| `created` | DateTimeField | created | datetime(6) | created |
| `has_matches` | BooleanField | has_matches | bool | has matches |
| `id (pk)` | AutoField | id | integer AUTO_INCREMENT | ID |
| `matched_rules` | ManyToManyField | matched_rules | through scanners.ScannerMatch | matched rules |
| `model_version` | CharField | model_version | varchar(30) | model version |
| `modified` | DateTimeField | modified | datetime(6) | modified |
| `results` | JSONField | results | json | results |
| `scanner` | PositiveSmallIntegerField | scanner | smallint UNSIGNED | scanner |
| `scannermatch` | ManyToOneRel | | integer | |
| `score` | DecimalField | score | numeric(6, 5) | score |
| `state` | PositiveSmallIntegerField | state | smallint UNSIGNED | state |
| `upload` | ForeignKey | upload_id | integer | upload |
| `version` | ForeignKey | version_id | integer UNSIGNED | version |
## Relations
| Field Name | Field Type | Database Column | Database Type | Related Model | Related Name |
|----------|----------|---------------|-------------|-------------|------------|
| `matched_rules` | ManyToManyField | matched_rules | through scanners.ScannerMatch | scanners.ScannerRule | results |
| `upload` | ForeignKey | upload_id | integer | files.FileUpload | scannerresults |
| `version` | ForeignKey | version_id | integer UNSIGNED | versions.Version | scannerresults |
fields_reverse_relation=[FieldReverseRelation(name='scannerresult_set', field_type='ManyToOneRel', field_db_type='integer', related_model='scanners.ScannerMatch', field_name_on_related_model='result', field_type_on_related_model='ForeignKey')]
## Reverse Relations
| Field Name | Field Type | Database Type | Related Model | Field Name on Related Model | Field Type on Related Model |
|----------|----------|-------------|-------------|---------------------------|---------------------------|
| `scannerresult_set` | ManyToOneRel | integer | scanners.ScannerMatch | result | ForeignKey |
## Methods
### Other Methods
| Method Name | Signature |
|-----------|---------|
| `add_yara_result` | `(self, rule, tags=None, meta=None)` |
| `can_report_feedback` | `(self)` |
| `can_revert_feedback` | `(self)` |
| `extract_rule_names` | `(self)` |
| `get_admin_absolute_url` | `(self)` |
| `get_admin_url_path` | `(self)` |
| `get_files_and_data_by_matched_rules` | `(self)` |
| `get_git_repository` | `(self)` |
| `get_next_by_created` | `(self, *, field=, is_next=True, **kwargs)` |
| `get_next_by_modified` | `(self, *, field=, is_next=True, **kwargs)` |
| `get_pretty_results` | `(self)` |
| `get_previous_by_created` | `(self, *, field=, is_next=False, **kwargs)` |
| `get_previous_by_modified` | `(self, *, field=, is_next=False, **kwargs)` |
| `get_rules_queryset` | `(self)` |
| `get_scanner_display` | `(self, *, field=)` |
| `get_scanner_name` | `(self)` |
| `get_state_display` | `(self, *, field=)` |
| `get_unfiltered_manager` | `()` |
| `reload` | `(self)` |
| `rule_model` | `(*args, **kwargs)` |
| `run_action` | `(version, *, check_mad_results=True)` |
| `serializable_reference` | `(self)` |
| `update` | `(self, **kw)` |
### Private Methods
| Method Name | Signature |
|-----------|---------|
| `_check_mad_results` | `(version)` |
| `_get_field_value_map` | `(self, meta, exclude=None)` |
## Custom Managers
### default
**Class:** `ManagerBase`
*Base for all managers in AMO.
Returns BaseQuerySets.
If a model has translated fields, they'll be attached through a transform
function.*
#### Custom Methods
##### `transform(self, fn)`
#### Custom QuerySet
**Class:** `BaseQuerySet`
*Represent a lazy database lookup for a set of objects.*
##### Custom Methods
###### `no_transforms(self)`
###### `only_translations(self)`
*Remove all transforms except translations.*
###### `optimized_count(self)`
*Slightly optimized count() for cases where there is a DISTINCT in the
queryset.
When a count() call is made on a queryset that has a distinct, that
causes django to run the full SELECT (including all fields, distinct,
ordering etc) in a subquery and then COUNT() on the result of that
subquery, which is costly/innefficient. That's tracked in
https://code.djangoproject.com/ticket/30685.
We can't easily fix the fact that there is a subquery, but we can
avoid selecting all fields and ordering in that subquery needlessly.*
###### `pop_transforms(self)`
###### `transform(self, fn)`
### objects
**Class:** `ManagerBase`
*Base for all managers in AMO.
Returns BaseQuerySets.
If a model has translated fields, they'll be attached through a transform
function.*
#### Custom Methods
##### `transform(self, fn)`
#### Custom QuerySet
**Class:** `BaseQuerySet`
*Represent a lazy database lookup for a set of objects.*
##### Custom Methods
###### `no_transforms(self)`
###### `only_translations(self)`
*Remove all transforms except translations.*
###### `optimized_count(self)`
*Slightly optimized count() for cases where there is a DISTINCT in the
queryset.
When a count() call is made on a queryset that has a distinct, that
causes django to run the full SELECT (including all fields, distinct,
ordering etc) in a subquery and then COUNT() on the result of that
subquery, which is costly/innefficient. That's tracked in
https://code.djangoproject.com/ticket/30685.
We can't easily fix the fact that there is a subquery, but we can
avoid selecting all fields and ordering in that subquery needlessly.*
###### `pop_transforms(self)`
###### `transform(self, fn)`
---
!!! THIS DOCUMENT WAS *AUTOGENERATED* ON 2025-08-31 !!!