submissions.models.report module

class submissions.models.report.Report(*args, **kwargs)[source]

Bases: submissions.behaviors.SubmissionRelatedObjectMixin, django.db.models.base.Model

Report on a Submission, written by a Contributor.

status

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

report_type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

submission

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

report_nr

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

vetted_by

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

invited

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

flagged

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

author

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

qualification

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

strengths

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

weaknesses

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

report

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

requested_changes

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

comments

Accessor to the related objects manager on the one-to-many relation created by GenericRelation.

In the example:

class Post(Model):
    comments = GenericRelation(Comment)

post.comments is a ReverseGenericManyToOneDescriptor instance.

validity

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

significance

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

originality

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

clarity

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

formatting

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

grammar

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

recommendation

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

remarks_for_editors

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

needs_doi

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

doideposit_needs_updating

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

genericdoideposit

Accessor to the related objects manager on the one-to-many relation created by GenericRelation.

In the example:

class Post(Model):
    comments = GenericRelation(Comment)

post.comments is a ReverseGenericManyToOneDescriptor instance.

doi_label

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

anonymous

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

pdf_report

The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:

>>> from myapp.models import MyModel
>>> instance = MyModel.objects.get(pk=1)
>>> instance.file.size

Assign a file object on assignment so you can do:

>>> with open('/path/to/hello.world') as f:
...     instance.file = File(f)
date_submitted

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

modified

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

file_attachment

The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:

>>> from myapp.models import MyModel
>>> instance = MyModel.objects.get(pk=1)
>>> instance.file.size

Assign a file object on assignment so you can do:

>>> with open('/path/to/hello.world') as f:
...     instance.file = File(f)
objects = <django.db.models.manager.ManagerFromReportQuerySet object>
save(*args, **kwargs)[source]

Update report number before saving on creation.

get_absolute_url()[source]

Return url of the Report on the Submission detail page.

get_notification_url(url_code)[source]

Return url related to the Report by the url_code meant for Notifications.

get_attachment_url()[source]

Return url of the Report its attachment if exists.

property is_in_draft

Return if Report is in draft.

property is_vetted

Return if Report is publicly available.

property is_unvetted

Return if Report is awaiting vetting.

property is_rejected

Return if Report is rejected.

property notification_name

Return string representation of this Report as shown in Notifications.

property doi_string

Return the doi with the registrant identifier prefix.

title

Return the submission’s title.

This property is (mainly) used to let Comments get the title of the Submission without overcomplicated logic.

property is_followup_report

Return if Report is a follow-up Report instead of a regular Report.

This property is used in the ReportForm, but will be candidate to become a database field if this information becomes necessary in more general information representation.

property associated_published_doi

Return the related Publication doi.

Check if the Report relates to a SciPost-published object. If it does, return the doi of the published object.

property relation_to_published

Return dictionary with published object information.

Check if the Report relates to a SciPost-published object. If it does, return a dict with info on relation to the published object, based on Crossref’s peer review content type.

property citation

Return the proper citation format for this Report.

create_doi_label()[source]

Create a doi in the default format.

latest_report_from_thread()[source]

Get latest Report of this Report’s author for the Submission thread.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

author_id
get_clarity_display(*, field=<django.db.models.fields.PositiveSmallIntegerField: clarity>)
get_formatting_display(*, field=<django.db.models.fields.SmallIntegerField: formatting>)
get_grammar_display(*, field=<django.db.models.fields.SmallIntegerField: grammar>)
get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_next_by_date_submitted(*, field=<django.db.models.fields.DateTimeField: date_submitted>, is_next=True, **kwargs)
get_next_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=True, **kwargs)
get_originality_display(*, field=<django.db.models.fields.PositiveSmallIntegerField: originality>)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
get_previous_by_date_submitted(*, field=<django.db.models.fields.DateTimeField: date_submitted>, is_next=False, **kwargs)
get_previous_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=False, **kwargs)
get_qualification_display(*, field=<django.db.models.fields.PositiveSmallIntegerField: qualification>)
get_recommendation_display(*, field=<django.db.models.fields.SmallIntegerField: recommendation>)
get_report_type_display(*, field=<django.db.models.fields.CharField: report_type>)
get_significance_display(*, field=<django.db.models.fields.PositiveSmallIntegerField: significance>)
get_status_display(*, field=<django.db.models.fields.CharField: status>)
get_validity_display(*, field=<django.db.models.fields.PositiveSmallIntegerField: validity>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

submission_id
vetted_by_id