Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Todo.description to Todo.title #661

Merged
merged 5 commits into from
Aug 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions orchestra/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,19 +177,19 @@ class TimeEntryAdmin(AjaxSelectAdmin):
@admin.register(Todo)
Copy link
Member

@marcua marcua Aug 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing checklist

  • Add a nested todo list template to a role (e.g., our internal design checklist)
  • check off some of the nested items
  • refresh and ensure they got added and checked off properly
  • open up the QA checklist (@Osmandina can show you how), leave two comments, and copy/paste the results
  • add a todo with a start date in the future. the task should appear in pending with that todo as the next step
  • add a todo with a due date in the future. task should appear in active with that todo as the next step

class TodoAdmin(admin.ModelAdmin):
autocomplete_fields = ('task', 'parent_todo')
list_display = ('id', 'created_at', 'task', 'description', 'completed')
list_display = ('id', 'created_at', 'task', 'title', 'completed')
ordering = ('-created_at',)
search_fields = (
'task__project__short_description', 'task__step__name',
'description')
'title')
list_filter = ('task__project__workflow_version',)


@admin.register(TodoQA)
class TodoQAAdmin(AjaxSelectAdmin):
list_display = ('id', 'created_at', 'todo', 'comment', 'approved')
ordering = ('-created_at',)
search_fields = ('todo__description', 'comment',)
search_fields = ('todo__title', 'comment',)


@admin.register(TodoListTemplate)
Expand Down
18 changes: 18 additions & 0 deletions orchestra/migrations/0085_rename_todo_description_to_title.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.2.13 on 2020-08-10 15:03

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('orchestra', '0084_workflowversion_abort_completion_function'),
]

operations = [
migrations.RenameField(
model_name='todo',
old_name='description',
new_name='title',
),
]
2 changes: 1 addition & 1 deletion orchestra/models/core/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class TodoMixin(object):
def __str__(self):
return '{} - {} ({})'.format(
self.task,
self.description,
self.title,
self.completed)


Expand Down
4 changes: 2 additions & 2 deletions orchestra/models/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ class Todo(TodoMixin, BaseModel):
The given task the Todo is attached to.
completed (boolean):
Whether the todo has been completed.
description (str):
title (str):
A text description of the Todo.
start_by_datetime (datetime.datetime):
The time to start the todo. (inclusive)
Expand Down Expand Up @@ -661,7 +661,7 @@ class Meta:

task = models.ForeignKey(
Task, related_name='todos', on_delete=models.CASCADE)
description = models.TextField()
title = models.TextField()
completed = models.BooleanField(default=False)
start_by_datetime = models.DateTimeField(null=True, blank=True)
due_datetime = models.DateTimeField(null=True, blank=True)
Expand Down