Commit 4b5475df authored by Matheus Miranda's avatar Matheus Miranda
Browse files

Add release_date and status to professor_message

parent 2380a0c5
# Generated by Django 2.2.24 on 2021-12-10 15:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('courses', '0037_auto_20211129_1752'),
]
operations = [
migrations.AddField(
model_name='professormessage',
name='release_date',
field=models.DateTimeField(blank=True, default=None, null=True, verbose_name='Date'),
),
migrations.AddField(
model_name='professormessage',
name='status',
field=models.CharField(choices=[('draft', 'Draft'), ('published', 'Published')], default='draft', max_length=64, verbose_name='Status'),
),
]
......@@ -748,6 +748,11 @@ class CourseAuthor(models.Model):
class ProfessorMessage(models.Model):
STATES = (
('draft', _('Draft')),
('published', _('Published')),
)
professor = models.ForeignKey(
settings.AUTH_USER_MODEL,
models.PROTECT,
......@@ -795,6 +800,19 @@ class ProfessorMessage(models.Model):
related_name='messages',
blank=True,
)
scheduled_task = GenericRelation(ScheduledTask, related_query_name='professor_message')
status = models.CharField(
_('Status'),
choices=STATES,
default=STATES[0][0],
max_length=64,
)
release_date = models.DateTimeField(
_('Date'),
null=True,
blank=True,
default=None,
)
def __str__(self):
return self.subject + " - " + str(self.date)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment