Return to API Reference.
Most important model within whole application. It provides connection with all other models.
Initially wanted to implement as models.signal handler - as used in django-issues. Ended up with simple wrapper for expending project’s timeline. Some more logic may be added over time.
Returns Config for this project.
Creates Transition objects linking all projects’ statuses with each other providing default task workflow schema.
Creates default configuration for given project.
If successful, project should change it’s state to State.CONFIG_CREATED. Note, that this method doesn’t make any database related queries - state should be flushed manually.
Creates repository for this project.
vcs_alias is retrieved using get_vcs_alias method but may be overridden by passing parameter directly.
If successful, project should change it’s state to State.REPOSITORY_CREATED. Note, that this method doesn’t make any database related queries - state should be flushed manually.
Parameters: |
|
---|---|
Raises: |
|
Creates default workflow for the project. We need to create objects required to work on issues (components, types, statuses with their transitions if custom workflow is used).
Workflow is retrieved using get_workflow method on the instance but may be overridden by passing parameter directly.
If successful, project should change it’s state to State.WORKFLOW_CREATED. Note, that this method doesn’t make any database related queries - state should be flushed manually.
Parameters: |
|
---|
Creates fork from internal context. As we use django-treebeard, we need to use it’s api to create a child.
Parameters: |
|
---|---|
Returns: | |
Raises: |
|
Returns activity stream for this projcet.
Returns all forks for this project, starting from root. Returned object is a list (not Queryset) and contains this instance.
Returns client command to run in order to clone this repository.
Returns Config for this project.
Returns fork of this project’s root for the given user. If user haven’t forked project from this instance’s tree, None is returned.
Returns full url of the project (with domain based on django sites framework).
Returns queryset of Transition objects related with this project.
Returns vcs_alias which should be already configured for this project. Defaulting to PROJECTOR_DEFAULT_VCS_BACKEND.
Returns True if this instance is a fork (has parent), False otherwise.
Creates all permissions for project’s author.
If successful, project should change it’s state to State.AUTHOR_PERMISSIONS_CREATED. Note, that this method doesn’t make any database related queries - state should be flushed manually.
Creates Membership for this project and it’s author. If author is a team, we need to create Team object too.
If successful, project should change it’s state to State.MEMBERSHIPS_CREATED. Note, that this method doesn’t make any database related queries - state should be flushed manually.
Prepares this project for repository creation process. Note that ProjectorError is raised if repository for this instance has been already created. Same exception is raised if vcs does not support backend for the given alias.
Parameters: |
|
---|
Should be called AFTER instance is saved into database as all methods here creates necessary models for the project and in order to create relations it is needed that instance is persisted first.
See also ProjectManager.
This model stores configuration on “per project” basis.
Milestone(id, project_id, name, slug, description, author_id, created_at, deadline, date_completed)
Component(id, project_id, name, slug, description)
Priority(id, name, description, order, project_id, slug)
Instances allow to change source Status to destination Status. Needed for custom workflows.
TaskType(id, name, description, order, project_id)
Task(created_at, author_id, author_ip, revision, summary, description, status_id, priority_id, type_id, owner_id, deadline, milestone_id, component_id, id_pk, id, project_id, edited_at, editor_id, editor_ip)
If comment is set, clean method won’t check if there were changes made to task itself
Creates revision (instance of TaskRevision) for this task. If comment has been set, it would be used in revision creation process.
Returns last TaskRevision (not self) attached to this task. If there were no changes made yet, None is returned.
Returns differences between old and new task instances, as dict. Fields would become keys of returned dict. Tuples of old value and new value would be dict’s values.
Returns content of the task, suitable as email message’s body.
Returns TaskRevision objects related to this Task instance. Each TaskRevision would have additional attribute changes which would containt result of Task.diff method. For first revision changes would be empty dict.
Notifies about task’s status. If recipient_list is None, would send a note to everyone who watch this task.
Returns TaskRevision objects related to this Task instance. Each TaskRevision would have additional attribute changes which would containt result of Task.diff method. For first revision changes would be empty dict.
TaskRevision(id, created_at, author_id, author_ip, revision, summary, description, status_id, priority_id, type_id, owner_id, deadline, milestone_id, component_id, task_id, comment)
Task(created_at, author_id, author_ip, revision, summary, description, status_id, priority_id, type_id, owner_id, deadline, milestone_id, component_id, id_pk, id, project_id, edited_at, editor_id, editor_ip)
If comment is set, clean method won’t check if there were changes made to task itself
Creates revision (instance of TaskRevision) for this task. If comment has been set, it would be used in revision creation process.
Returns last TaskRevision (not self) attached to this task. If there were no changes made yet, None is returned.
Returns differences between old and new task instances, as dict. Fields would become keys of returned dict. Tuples of old value and new value would be dict’s values.
Returns content of the task, suitable as email message’s body.
Returns TaskRevision objects related to this Task instance. Each TaskRevision would have additional attribute changes which would containt result of Task.diff method. For first revision changes would be empty dict.
Notifies about task’s status. If recipient_list is None, would send a note to everyone who watch this task.
Returns TaskRevision objects related to this Task instance. Each TaskRevision would have additional attribute changes which would containt result of Task.diff method. For first revision changes would be empty dict.
Membership(id, member_id, project_id, joined_at)
Team(id, group_id, project_id, joined_at)
Converts User instance into Team instance. It won’t delete user, his or her profile would simply get team attribute set to newly created Team and is_team attribute would be set to True.
Returns queryset of Team instances of groups for given user.