AttributeType

Bases: TimeStampedModel

An attribute type indicates the data type of the attribute. Examples include Date, Float, Int, Text, and Yes/No.

Attributes:
  • name (str) –

    name of attribute data type

Project

Bases: TimeStampedModel

A project is a container that includes users, allocations, publications, grants, and other research output.

Attributes:
  • title (str) –

    name of the project

  • pi (User) –

    represents the User object of the project's PI

  • description (str) –

    description of the project

  • field_of_science (FieldOfScience) –

    represents the field of science for this project

  • status (ProjectStatusChoice) –

    represents the ProjectStatusChoice of this project

  • force_review (bool) –

    indicates whether or not to force a review for the project

  • requires_review (bool) –

    indicates whether or not the project requires review

last_project_review property

Returns:
  • ProjectReview

    the last project review that was created for this project

latest_grant property

Returns:
  • Grant

    the most recent grant for this project, or None if there are no grants

latest_publication property

Returns:
  • Publication

    the most recent publication for this project, or None if there are no publications

needs_review property

Returns:
  • bool

    whether or not the project needs review

add_user

Adds a user to the project.

If a ProjectUser already exists, its role will be set to "Active" and its role updated. Otherwise, creates a new ProjectUser.

Parameters:
  • user (User) –

    User to add.

  • role_choice (ProjetUserRoleChoice) –

    Role to give the project user.

  • signal_sender (str, default: None ) –

    Sender for the project_activate_user signal.

archive

Sets the project status to "Archived" and expires all active allocations. Sends project archive email to project users.

clean

Validates the project and raises errors if the project is invalid.

get_user_emails

Gets a set of user emails for notifications.

Parameters:
  • ignore_disabled_notifications (bool, default: False ) –

    If True, include project users that have enable_notifications off.

Returns:
  • set( set[str] ) –

    A set of user emails for notifications.

has_perm

Parameters:
  • user (User) –

    user to check permissions for

  • perm (ProjectPermission) –

    permission to check for in user's list

Returns:
  • bool

    whether or not the user has the specified permission

remove_user

Marks a ProjectUser and any associated AllocationUsers as 'Removed'.

Parameters:
  • user (User | ProjectUser) –

    User to remove.

  • signal_sender (str, default: None ) –

    Sender for the project_remove_user and allocation_remove_user signals.

Raises:
  • DoesNotExist

    If user is a User and that user is not found in the Project.

user_permissions

Parameters:
  • user (User) –

    represents the user whose permissions are to be retrieved

Returns:
  • list[ProjectPermission]: a list of the user's permissions for the project

ProjectAdminComment

Bases: TimeStampedModel

A project admin comment is a comment that an admin can make on a project.

Attributes:
  • project (Project) –

    links the project the comment is from to the comment

  • author (User) –

    represents the admin who authored the comment

  • comment (str) –

    text input from the project admin containing the comment

ProjectAttribute

Bases: TimeStampedModel

A project attribute class links a project attribute type and a project.

Attributes:
  • proj_attr_type (ProjectAttributeType) –

    project attribute type to link

  • project (Project) –

    project to link

  • value (str) –

    value of the project attribute

clean

Validates the project and raises errors if the project is invalid.

save

Saves the project attribute.

ProjectAttributeType

Bases: TimeStampedModel

A project attribute type indicates the type of the attribute. Examples include Project ID and Account Number.

Attributes:
  • attribute_type (AttributeType) –

    indicates the data type of the attribute

  • name (str) –

    name of project attribute type

  • has_usage (bool) –

    indicates whether or not the attribute type has usage

  • is_required (bool) –

    indicates whether or not the attribute is required

  • is_unique (bool) –

    indicates whether or not the value is unique

  • is_private (bool) –

    indicates whether or not the attribute type is private

  • is_changeable (bool) –

    indicates whether or not the attribute type is changeable

ProjectAttributeUsage

Bases: TimeStampedModel

Project attribute usage indicates the usage of a project attribute.

Attributes:
  • project_attribute (ProjectAttribute) –

    links the usage to its project attribute

  • value (float) –

    usage value of the project attribute

ProjectPermission

Bases: Enum

A project permission stores the user, manager, pi, and update fields of a project.

ProjectReview

Bases: TimeStampedModel

A project review is what a user submits to their PI when their project status is Pending.

Attributes:
  • project (Project) –

    links the project to its review

  • status (ProjectReviewStatusChoice) –

    links the project review to its status

  • reason_for_not_updating_project (str) –

    text input from the user indicating why the project was not updated

ProjectReviewStatusChoice

Bases: TimeStampedModel

A project review status choice is an option a user can choose when setting a project's status. Examples include Completed and Pending.

Attributes:
  • name (str) –

    name of the status choice

ProjectStatusChoice

Bases: TimeStampedModel

A project status choice indicates the status of the project. Examples include Active, Archived, and New.

Attributes:
  • name (str) –

    name of project status choice

ProjectUser

Bases: TimeStampedModel

A project user represents a user on the project.

Attributes:
  • user (User) –

    represents the User object of the project user

  • project (Project) –

    links user to its project

  • role (ProjectUserRoleChoice) –

    links the project user role choice to the user

  • status (ProjectUserStatusChoice) –

    links the project user status choice to the user

  • enable_notifications (bool) –

    indicates whether or not the user should enable notifications

ProjectUserMessage

Bases: TimeStampedModel

A project user message is a message sent to a user in a project.

Attributes:
  • project (Project) –

    links the project the message is from to the message

  • author (User) –

    represents the user who authored the message

  • is_private (bool) –

    indicates whether or not the message is private

  • message (str) –

    text input from the user containing the message

ProjectUserRoleChoice

Bases: TimeStampedModel

A project user role choice is an option a PI, manager, or admin has while selecting a user's role. Examples include Manager and User.

Attributes:
  • name (str) –

    name of the user role choice

ProjectUserStatusChoice

Bases: TimeStampedModel

A project user status choice indicates the status of a project user. Examples include Active, Pending, and Denied.

Attributes:
  • name (str) –

    name of the project user status choice