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
bd65f027
Commit
bd65f027
authored
Sep 15, 2020
by
Laury Bueno
Browse files
[Classes] Add a certificate_template to each class
parent
7a31e4c9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
courses/classes/models.py
courses/classes/models.py
+7
-0
courses/migrations/0016_class_certificate_template.py
courses/migrations/0016_class_certificate_template.py
+20
-0
No files found.
courses/classes/models.py
View file @
bd65f027
...
...
@@ -32,6 +32,13 @@ class Class(models.Model):
_
(
'Certification Allowed Even Without Progress'
),
default
=
False
,
)
certificate_template
=
models
.
ForeignKey
(
'certification.CertificateTemplate'
,
models
.
SET_NULL
,
verbose_name
=
_
(
'CertificateTemplate'
),
related_name
=
'classes'
,
null
=
True
,
)
def
__str__
(
self
):
return
u
'%s @ %s'
%
(
self
.
name
,
self
.
course
)
...
...
courses/migrations/0016_class_certificate_template.py
0 → 100644
View file @
bd65f027
# Generated by Django 2.2.16 on 2020-09-15 20:03
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'certification'
,
'0004_auto_20200703_2023'
),
(
'courses'
,
'0015_auto_20200818_0320'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'class'
,
name
=
'certificate_template'
,
field
=
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
SET_NULL
,
related_name
=
'classes'
,
to
=
'certification.CertificateTemplate'
,
verbose_name
=
'CertificateTemplate'
),
),
]
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