Skip to content

Commit

Permalink
Add notes to tasks and task chunks (closes #72)
Browse files Browse the repository at this point in the history
  • Loading branch information
wichmannpas committed Sep 7, 2018
1 parent 3f2dc70 commit 42436de
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
27 changes: 27 additions & 0 deletions task/migrations/0012_auto_20180907_1657.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by Django 2.1 on 2018-09-07 14:57

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('task', '0011_auto_20180906_1434'),
]

operations = [
migrations.AlterModelOptions(
name='taskchunkseries',
options={'verbose_name_plural': 'task chunk series'},
),
migrations.AddField(
model_name='task',
name='notes',
field=models.TextField(null=True),
),
migrations.AddField(
model_name='taskchunk',
name='notes',
field=models.TextField(null=True),
),
]
4 changes: 4 additions & 0 deletions task/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ class Task(models.Model):

labels = models.ManyToManyField('label.Label', related_name='tasks')

notes = models.TextField(null=True)

objects = TaskManager()

def __str__(self) -> str:
Expand Down Expand Up @@ -389,6 +391,8 @@ class TaskChunk(models.Model):
))
finished = models.BooleanField(default=False)

notes = models.TextField(null=True)

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

Expand Down
2 changes: 2 additions & 0 deletions task/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class Meta:
'start',
'deadline',
'labels',
'notes',
'scheduled_duration',
'finished_duration',
)
Expand Down Expand Up @@ -141,6 +142,7 @@ class Meta:
'day_order',
'duration',
'finished',
'notes',
)
series = serializers.PrimaryKeyRelatedField(read_only=True)
day = DayOrScheduleField()
Expand Down

0 comments on commit 42436de

Please sign in to comment.