Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
MOOC packages by hacklab
django-courses
Commits
71968120
Commit
71968120
authored
Aug 18, 2020
by
Bruno Martin
Browse files
improve professor messages adding classroom
parent
d6fcc5a5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
0 deletions
+44
-0
courses/migrations/0014_professormessage_classrooms.py
courses/migrations/0014_professormessage_classrooms.py
+18
-0
courses/migrations/0015_auto_20200818_0320.py
courses/migrations/0015_auto_20200818_0320.py
+19
-0
courses/models.py
courses/models.py
+7
-0
No files found.
courses/migrations/0014_professormessage_classrooms.py
0 → 100644
View file @
71968120
# 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'
),
),
]
courses/migrations/0015_auto_20200818_0320.py
0 → 100644
View file @
71968120
# 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'
),
),
]
courses/models.py
View file @
71968120
...
...
@@ -664,6 +664,7 @@ class ProfessorMessage(models.Model):
models
.
CASCADE
,
verbose_name
=
_
(
'Course'
),
null
=
True
,
blank
=
True
,
)
groups
=
models
.
ManyToManyField
(
Group
,
...
...
@@ -678,6 +679,12 @@ class ProfessorMessage(models.Model):
related_name
=
'message_courses'
,
blank
=
True
,
)
classrooms
=
models
.
ManyToManyField
(
'Classroom'
,
verbose_name
=
_
(
'Classrooms'
),
related_name
=
'messages'
,
blank
=
True
,
)
def
__str__
(
self
):
return
self
.
professor
.
name
+
" - "
+
self
.
subject
+
" - "
+
str
(
self
.
date
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment