Skip to content

Commit

Permalink
Revert "Checklist models (#449)" (#450)
Browse files Browse the repository at this point in the history
* Revert "Checklist models (#449)"

This reverts commit a9de904.

* Fix httpsig package version

* Update requirements.txt
  • Loading branch information
paopow committed Jun 15, 2018
1 parent a9de904 commit ae5cab3
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 115 deletions.
54 changes: 0 additions & 54 deletions orchestra/migrations/0076_auto_20180612_1905.py

This file was deleted.

7 changes: 0 additions & 7 deletions orchestra/models/core/mixins.py
Expand Up @@ -188,13 +188,6 @@ def __str__(self):
self.completed)


class ChecklistTemplateMixin(object):

def __str__(self):
return '{} - {}'.format(
self.name, self.description)


class PayRateMixin(object):

def __str__(self):
Expand Down
47 changes: 1 addition & 46 deletions orchestra/models/core/models.py
Expand Up @@ -6,7 +6,6 @@
from phonenumber_field.modelfields import PhoneNumberField

from orchestra.models.core.mixins import CertificationMixin
from orchestra.models.core.mixins import ChecklistTemplateMixin
from orchestra.models.core.mixins import PayRateMixin
from orchestra.models.core.mixins import ProjectMixin
from orchestra.models.core.mixins import StepMixin
Expand Down Expand Up @@ -577,34 +576,6 @@ class PayRate(PayRateMixin, models.Model):
end_date = models.DateField(null=True, blank=True)


class ChecklistTemplate (ChecklistTemplateMixin, BaseModel):
"""
A checklist template
Attributes:
slug (str):
The string that use to refer the checklist
name (str):
The name of the checklist
description (str):
A text description of the checklist
creator (orchestra.models.Worker)
The worker who creates the checklist. This field is null
if it is generated by the system.
todos (str)
A JSON blob that describe the todos in the checklist
"""
class Meta:
app_label = 'orchestra'

slug = models.CharField(max_length=200, unique=True)
name = models.CharField(max_length=200)
description = models.TextField()
creator = models.ForeignKey(
Worker, null=True, related_name='creator', on_delete=models.CASCADE)
todos = JSONField(default={'list': []})


class Todo(TodoMixin, BaseModel):
"""
A todo on a task.
Expand All @@ -619,17 +590,7 @@ class Todo(TodoMixin, BaseModel):
start_by_datetime (datetime.datetime):
The time to start the todo. (inclusive)
due_datetime (datetime.datetime):
The time the todo is due
skipped (boolean):
Whether the todo is skipped
parent_todo (orchestra.models.Todo):
The parent todo item
template (orchestra.models.ChecklistTemplate)
The template the todo is based on
log (str)
A JSON blob that records the user actions
with this todo
The time the todo is due.
Constraints:
`task` and `assignment_counter` are taken to be unique_together.
Expand All @@ -646,12 +607,6 @@ class Meta:
completed = models.BooleanField(default=False)
start_by_datetime = models.DateTimeField(null=True, blank=True)
due_datetime = models.DateTimeField(null=True, blank=True)
skipped = models.BooleanField(default=False)
parent_todo = models.ForeignKey(
'self', null=True, related_name='parent')
template = models.ForeignKey(
ChecklistTemplate, null=True, related_name='template')
log = JSONField(default={'actions': []})


class SanityCheck(SanityCheckMixin, BaseModel):
Expand Down
8 changes: 2 additions & 6 deletions orchestra/tests/test_todos.py
Expand Up @@ -49,15 +49,13 @@ def _verify_time_entries(self, data):
self.assertTrue(serializer.is_valid())

def _todo_data(
self, task, description, completed,
skipped=False, start_by=None, due=None):
self, task, description, completed, start_by=None, due=None):
return {
'task': task.id,
'completed': completed,
'description': description,
'start_by_datetime': start_by,
'due_datetime': due,
'skipped': skipped
'due_datetime': due
}

def _verify_todo_content(self, todo, expected_todo):
Expand Down Expand Up @@ -147,7 +145,6 @@ def test_create_todo_with_start_by_datetime(self):
start_by_todo.task,
START_DESCRIPTION,
False,
False,
self.deadline.strftime('%Y-%m-%dT%H:%M:%SZ'),
None)
], True)
Expand All @@ -165,7 +162,6 @@ def test_create_todo_with_due_datetime(self):
due_todo.task,
DUE_DESCRIPTION,
False,
False,
None,
self.deadline.strftime('%Y-%m-%dT%H:%M:%SZ')),
], True)
1 change: 0 additions & 1 deletion orchestra/todos/serializers.py
Expand Up @@ -13,7 +13,6 @@ class Meta:
'task',
'description',
'completed',
'skipped',
'start_by_datetime',
'due_datetime')
read_only_fields = ('id',)
2 changes: 1 addition & 1 deletion requirements.txt
Expand Up @@ -34,7 +34,7 @@ django-gulp==2.5.1
django-related-admin==0.5.0
django-ajax-selects==1.7.0
django-kronos==1.0
httpsig==1.1.2 # The 1.2.0 release breaks our tests
httpsig==1.1.2 # The 1.2.0 release breaks our tests, so we pin this version.
markdown2==2.3.4
timeout-decorator==0.4.0
phonenumbers==8.9.0
Expand Down

0 comments on commit ae5cab3

Please sign in to comment.