Commit 71968120 authored by Bruno Martin's avatar Bruno Martin
Browse files

improve professor messages adding classroom

parent d6fcc5a5
# Generated by Django 2.2.14 on 2020-08-15 02:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('courses', '0013_auto_20200729_1612'),
]
operations = [
migrations.AddField(
model_name='professormessage',
name='classrooms',
field=models.ManyToManyField(blank=True, related_name='messages', to='courses.Classroom', verbose_name='Classrooms'),
),
]
# Generated by Django 2.2.14 on 2020-08-18 06:20
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('courses', '0014_professormessage_classrooms'),
]
operations = [
migrations.AlterField(
model_name='professormessage',
name='course',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='courses.Course', verbose_name='Course'),
),
]
...@@ -664,6 +664,7 @@ class ProfessorMessage(models.Model): ...@@ -664,6 +664,7 @@ class ProfessorMessage(models.Model):
models.CASCADE, models.CASCADE,
verbose_name=_('Course'), verbose_name=_('Course'),
null=True, null=True,
blank=True,
) )
groups = models.ManyToManyField( groups = models.ManyToManyField(
Group, Group,
...@@ -678,6 +679,12 @@ class ProfessorMessage(models.Model): ...@@ -678,6 +679,12 @@ class ProfessorMessage(models.Model):
related_name='message_courses', related_name='message_courses',
blank=True, blank=True,
) )
classrooms = models.ManyToManyField(
'Classroom',
verbose_name=_('Classrooms'),
related_name='messages',
blank=True,
)
def __str__(self): def __str__(self):
return self.professor.name + " - " + self.subject + " - " + str(self.date) return self.professor.name + " - " + 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