abuse.ContentDecision

Model Info

Key

Value

Model Name

ContentDecision

Verbose Name

content decision

Verbose Name Plural

content decisions

Docstring

ContentDecision(id, created, modified, action, cinder_id, action_date, reasoning, private_notes, appeal_job, cinder_job, override_of, reviewer_user, addon, user, rating, collection, metadata, from_job_queue)

Is Abstract

False

Is Proxy

False

Is Managed

True

Ordering

[]

Permissions

[]

Default Permissions

(‘add’, ‘change’, ‘delete’, ‘view’)

Indexes

[]

Constraints

[<CheckConstraint: check=(OR: (AND: (‘addon__isnull’, False), (‘collection__isnull’, True), (‘rating__isnull’, True), (‘user__isnull’, True)), (AND: (‘addon__isnull’, True), (‘collection__isnull’, True), (‘rating__isnull’, True), (‘user__isnull’, False)), (AND: (‘addon__isnull’, True), (‘collection__isnull’, True), (‘rating__isnull’, False), (‘user__isnull’, True)), (AND: (‘addon__isnull’, True), (‘collection__isnull’, False), (‘rating__isnull’, True), (‘user__isnull’, True))) name=’just_one_of_addon_user_rating_collection_must_be_set’>]

Database Table

abuse_cinderdecision

Base Manager

None

Default Manager

None

File

/data/olympia/src/olympia/abuse/models.py

Starting Line Number

986

Method Resolution Order

(<class ‘olympia.abuse.models.ContentDecision’>, <class ‘olympia.amo.models.ModelBase’>, <class ‘olympia.amo.models.SaveUpdateMixin’>, <class ‘django.db.models.base.Model’>, <class ‘django.db.models.utils.AltersData’>, <class ‘object’>)

Fields

Field Name

Field Type

Database Column

Database Type

Verbose Name

ContentDecision_policies+

ManyToOneRel

integer

ContentDecision_target_versions+

ManyToOneRel

integer

action

PositiveSmallIntegerField

action

smallint UNSIGNED

action

action_date

DateTimeField

date

datetime(6)

action date

activities

ManyToManyField

activities

through activity.ContentDecisionLog

activities

addon

ForeignKey

addon_id

integer UNSIGNED

addon

appeal_job

ForeignKey

appeal_job_id

integer

appeal job

appeals

ManyToOneRel

integer

cinder_id

CharField

cinder_id

varchar(36)

cinder id

cinder_job

ForeignKey

cinder_job_id

integer

cinder job

collection

ForeignKey

collection_id

integer UNSIGNED

collection

contentdecisionlog

ManyToOneRel

integer

created

DateTimeField

created

datetime(6)

created

from_job_queue

CharField

from_job_queue

varchar(64)

from job queue

id (pk)

AutoField

id

integer AUTO_INCREMENT

ID

metadata

JSONField

metadata

json

metadata

modified

DateTimeField

modified

datetime(6)

modified

overridden_by

OneToOneRel

integer

override_of

OneToOneField

override_of_id

integer

override of

policies

ManyToManyField

policies

through abuse.ContentDecision_policies

policies

private_notes

TextField

private_notes

longtext

private notes

rating

ForeignKey

rating_id

integer UNSIGNED

rating

reasoning

TextField

reasoning

longtext

reasoning

reviewer_user

ForeignKey

reviewer_user_id

integer

reviewer user

target_versions

ManyToManyField

target_versions

through abuse.ContentDecision_target_versions

target versions

user

ForeignKey

user_id

integer

user

Relations

Field Name

Field Type

Database Column

Database Type

Related Model

Related Name

activities

ManyToManyField

activities

through activity.ContentDecisionLog

activity.ActivityLog

contentdecision_set

addon

ForeignKey

addon_id

integer UNSIGNED

addons.Addon

decisions_on

appeal_job

ForeignKey

appeal_job_id

integer

abuse.CinderJob

appealed_decisions

cinder_job

ForeignKey

cinder_job_id

integer

abuse.CinderJob

decisions

collection

ForeignKey

collection_id

integer UNSIGNED

bandwagon.Collection

decisions_on

override_of

OneToOneField

override_of_id

integer

abuse.ContentDecision

overridden_by

policies

ManyToManyField

policies

through abuse.ContentDecision_policies

abuse.CinderPolicy

contentdecision_set

rating

ForeignKey

rating_id

integer UNSIGNED

ratings.Rating

decisions_on

reviewer_user

ForeignKey

reviewer_user_id

integer

users.UserProfile

decisions_made_by

target_versions

ManyToManyField

target_versions

through abuse.ContentDecision_target_versions

versions.Version

contentdecision_set

user

ForeignKey

user_id

integer

users.UserProfile

decisions_on

fields_reverse_relation=[FieldReverseRelation(name=’ContentDecision_policies+ (no reverse relation allowed)’, field_type=’ManyToOneRel’, field_db_type=’integer’, related_model=’abuse.ContentDecision_policies’, field_name_on_related_model=’contentdecision’, field_type_on_related_model=’ForeignKey’), FieldReverseRelation(name=’ContentDecision_target_versions+ (no reverse relation allowed)’, field_type=’ManyToOneRel’, field_db_type=’integer’, related_model=’abuse.ContentDecision_target_versions’, field_name_on_related_model=’contentdecision’, field_type_on_related_model=’ForeignKey’), FieldReverseRelation(name=’overridden_by’, field_type=’OneToOneRel’, field_db_type=’integer’, related_model=’abuse.ContentDecision’, field_name_on_related_model=’override_of’, field_type_on_related_model=’OneToOneField’), FieldReverseRelation(name=’appeals’, field_type=’ManyToOneRel’, field_db_type=’integer’, related_model=’abuse.CinderAppeal’, field_name_on_related_model=’decision’, field_type_on_related_model=’ForeignKey’), FieldReverseRelation(name=’contentdecision_set’, field_type=’ManyToOneRel’, field_db_type=’integer’, related_model=’activity.ContentDecisionLog’, field_name_on_related_model=’decision’, 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

ContentDecision_policies+ (no reverse relation allowed)

ManyToOneRel

integer

abuse.ContentDecision_policies

contentdecision

ForeignKey

ContentDecision_target_versions+ (no reverse relation allowed)

ManyToOneRel

integer

abuse.ContentDecision_target_versions

contentdecision

ForeignKey

appeals

ManyToOneRel

integer

abuse.CinderAppeal

decision

ForeignKey

contentdecision_set

ManyToOneRel

integer

activity.ContentDecisionLog

decision

ForeignKey

overridden_by

OneToOneRel

integer

abuse.ContentDecision

override_of

OneToOneField

Methods

Other Methods

Method Name

Signature

appeal

(self, *, abuse_report, appeal_text, user, is_reporter)

appealed_decision_already_made

(self)

can_be_appealed

(self, *, is_reporter, abuse_report=None)

execute_action

(self, *, release_hold=False)

get_action_display

(self, *, field=<django.db.models.fields.PositiveSmallIntegerField: action>)

get_action_helper

(self)

get_admin_absolute_url

(self)

get_admin_url_path

(self)

get_next_by_created

(self, *, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)

get_next_by_modified

(self, *, field=<django.db.models.fields.DateTimeField: modified>, is_next=True, **kwargs)

get_policy_texts

(self)

get_previous_by_created

(self, *, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)

get_previous_by_modified

(self, *, field=<django.db.models.fields.DateTimeField: modified>, is_next=False, **kwargs)

get_reference_id

(self, short=True)

get_target_display

(self)

get_target_name

(self)

get_target_review_url

(self)

get_unfiltered_manager

()

reload

(self)

report_to_cinder

(self, entity_helper)

requeue_held_action

(self, *, user, notes)

send_notifications

(self, *, notify_owners=True)

serializable_reference

(self)

update

(self, **kw)

Private Methods

Method Name

Signature

_get_field_value_map

(self, meta, exclude=None)

Custom Managers

default

Class: ContentDecisionManager

*Base for all managers in AMO.

Returns BaseQuerySets.

If a model has translated fields, they’ll be attached through a transform function.*

Custom Methods

awaiting_action(self)

*Returns decisions that have not been actioned, i.e. do not have an action_date - and have not been overridden by a later decision. These decisions are held for a 2nd level approval.

Note: the logic for whether a decison should be held, and not have an action_date, or be immediately actioned and have an action_date is determined per ContentAction - see ContentAction.should_hold_action.*

transform(self, fn)

Custom QuerySet

Class: BaseQuerySet

Represent a lazy database lookup for a set of objects.

Custom Methods
get_with_primary_fallback(self, *args, **kwargs)

*Like get(), but if using a non-default database and DoesNotExist is raised, another attempt is made using the default database instead.

Intended to be used in places where replication lag could cause the object not to exist for a brief moment and forcing use of primary db at all times is undesirable.*

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: ContentDecisionManager

*Base for all managers in AMO.

Returns BaseQuerySets.

If a model has translated fields, they’ll be attached through a transform function.*

Custom Methods

awaiting_action(self)

*Returns decisions that have not been actioned, i.e. do not have an action_date - and have not been overridden by a later decision. These decisions are held for a 2nd level approval.

Note: the logic for whether a decison should be held, and not have an action_date, or be immediately actioned and have an action_date is determined per ContentAction - see ContentAction.should_hold_action.*

transform(self, fn)

Custom QuerySet

Class: BaseQuerySet

Represent a lazy database lookup for a set of objects.

Custom Methods
get_with_primary_fallback(self, *args, **kwargs)

*Like get(), but if using a non-default database and DoesNotExist is raised, another attempt is made using the default database instead.

Intended to be used in places where replication lag could cause the object not to exist for a brief moment and forcing use of primary db at all times is undesirable.*

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-10-07 !!!