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) |
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 |
980 |
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 |
---|---|---|---|---|
|
ManyToOneRel |
integer |
||
|
ManyToOneRel |
integer |
||
|
PositiveSmallIntegerField |
action |
smallint UNSIGNED |
action |
|
DateTimeField |
date |
datetime(6) |
action date |
|
ManyToManyField |
activities |
through activity.ContentDecisionLog |
activities |
|
ForeignKey |
addon_id |
integer UNSIGNED |
addon |
|
ForeignKey |
appeal_job_id |
integer |
appeal job |
|
ManyToOneRel |
integer |
||
|
CharField |
cinder_id |
varchar(36) |
cinder id |
|
ForeignKey |
cinder_job_id |
integer |
cinder job |
|
ForeignKey |
collection_id |
integer UNSIGNED |
collection |
|
ManyToOneRel |
integer |
||
|
DateTimeField |
created |
datetime(6) |
created |
|
AutoField |
id |
integer AUTO_INCREMENT |
ID |
|
JSONField |
metadata |
json |
metadata |
|
DateTimeField |
modified |
datetime(6) |
modified |
|
OneToOneRel |
integer |
||
|
OneToOneField |
override_of_id |
integer |
override of |
|
ManyToManyField |
policies |
through abuse.ContentDecision_policies |
policies |
|
TextField |
private_notes |
longtext |
private notes |
|
ForeignKey |
rating_id |
integer UNSIGNED |
rating |
|
TextField |
reasoning |
longtext |
reasoning |
|
ForeignKey |
reviewer_user_id |
integer |
reviewer user |
|
ManyToManyField |
target_versions |
through abuse.ContentDecision_target_versions |
target versions |
|
ForeignKey |
user_id |
integer |
user |
Relations
Field Name |
Field Type |
Database Column |
Database Type |
Related Model |
Related Name |
---|---|---|---|---|---|
|
ManyToManyField |
activities |
through activity.ContentDecisionLog |
activity.ActivityLog |
contentdecision_set |
|
ForeignKey |
addon_id |
integer UNSIGNED |
addons.Addon |
decisions_on |
|
ForeignKey |
appeal_job_id |
integer |
abuse.CinderJob |
appealed_decisions |
|
ForeignKey |
cinder_job_id |
integer |
abuse.CinderJob |
decisions |
|
ForeignKey |
collection_id |
integer UNSIGNED |
bandwagon.Collection |
decisions_on |
|
OneToOneField |
override_of_id |
integer |
abuse.ContentDecision |
overridden_by |
|
ManyToManyField |
policies |
through abuse.ContentDecision_policies |
abuse.CinderPolicy |
contentdecision_set |
|
ForeignKey |
rating_id |
integer UNSIGNED |
ratings.Rating |
decisions_on |
|
ForeignKey |
reviewer_user_id |
integer |
users.UserProfile |
decisions_made_by |
|
ManyToManyField |
target_versions |
through abuse.ContentDecision_target_versions |
versions.Version |
contentdecision_set |
|
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 |
---|---|---|---|---|---|
|
ManyToOneRel |
integer |
abuse.ContentDecision_policies |
contentdecision |
ForeignKey |
|
ManyToOneRel |
integer |
abuse.ContentDecision_target_versions |
contentdecision |
ForeignKey |
|
ManyToOneRel |
integer |
abuse.CinderAppeal |
decision |
ForeignKey |
|
ManyToOneRel |
integer |
activity.ContentDecisionLog |
decision |
ForeignKey |
|
OneToOneRel |
integer |
abuse.ContentDecision |
override_of |
OneToOneField |
Methods
Other Methods
Method Name |
Signature |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Private Methods
Method Name |
Signature |
---|---|
|
|
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
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
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-07-11 !!!