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
b3de967e
Commit
b3de967e
authored
Feb 02, 2021
by
Matheus Miranda
Browse files
Add CourseTrack model
parent
b0ef725d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
courses/models.py
courses/models.py
+25
-0
No files found.
courses/models.py
View file @
b3de967e
...
@@ -327,6 +327,31 @@ class Course(models.Model):
...
@@ -327,6 +327,31 @@ class Course(models.Model):
CourseMaterial
.
objects
.
create
(
course
=
self
)
CourseMaterial
.
objects
.
create
(
course
=
self
)
class
CourseTrack
(
models
.
Model
):
name
=
models
.
CharField
(
_
(
'Name'
),
max_length
=
255
,
blank
=
True
,
)
slug
=
AutoSlugField
(
_
(
'Slug'
),
populate_from
=
"name"
,
unique
=
True
)
courses
=
models
.
ManyToManyField
(
Course
,
verbose_name
=
'courses'
,
blank
=
True
,
)
class
Meta
:
verbose_name
=
_
(
'Course Track'
)
verbose_name_plural
=
_
(
'Course Tracks'
)
def
__str__
(
self
):
return
self
.
name
class
CourseStudent
(
models
.
Model
):
class
CourseStudent
(
models
.
Model
):
user
=
models
.
ForeignKey
(
user
=
models
.
ForeignKey
(
settings
.
AUTH_USER_MODEL
,
settings
.
AUTH_USER_MODEL
,
...
...
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