Skip to content

Commit

Permalink
Modificações no model Execucao #22
Browse files Browse the repository at this point in the history
  • Loading branch information
tacianosilva committed Nov 26, 2020
1 parent ce53627 commit 9219f62
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 1 deletion.
18 changes: 18 additions & 0 deletions tasktracking/tasks/migrations/0006_auto_20201126_0942.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.1.2 on 2020-11-26 12:42

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('tasks', '0005_tag_tarefa'),
]

operations = [
migrations.AlterField(
model_name='execucao',
name='fim',
field=models.DateTimeField(blank=True, null=True),
),
]
18 changes: 18 additions & 0 deletions tasktracking/tasks/migrations/0007_execucao_status.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.1.2 on 2020-11-26 12:52

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('tasks', '0006_auto_20201126_0942'),
]

operations = [
migrations.AddField(
model_name='execucao',
name='status',
field=models.CharField(choices=[('1', 'Parada'), ('2', 'Executando'), ('3', 'Pausada')], max_length=1, null=True),
),
]
13 changes: 12 additions & 1 deletion tasktracking/tasks/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,18 @@ class Execucao(models.Model):
Args:
models ([type]): [Representa uma execução de uma tarefa.]
"""
PARADA = "1"
EXECUTANDO = "2"
PAUSADA = "3"

STATUS_CHOICES = (
("1", "Parada"),
("2", "Executando"),
("3", "Pausada"),
)

inicio = models.DateTimeField()
fim = models.DateTimeField()
fim = models.DateTimeField(null=True, blank=True)
status = models.CharField(max_length=1, choices=STATUS_CHOICES, null=True)
tarefa = models.ForeignKey(Tarefa, on_delete=models.PROTECT)
usuario = models.ForeignKey(Usuario, on_delete=models.PROTECT)
File renamed without changes.

0 comments on commit 9219f62

Please sign in to comment.