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
eab22c6a
Commit
eab22c6a
authored
Aug 04, 2021
by
Bruno Martin
Browse files
add receipt_template to class model
parent
1d4ffc65
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletion
+33
-1
courses/classes/models.py
courses/classes/models.py
+8
-1
courses/migrations/0032_auto_20210803_0308.py
courses/migrations/0032_auto_20210803_0308.py
+25
-0
No files found.
courses/classes/models.py
View file @
eab22c6a
...
...
@@ -36,7 +36,14 @@ class Class(models.Model):
'certification.CertificateTemplate'
,
models
.
SET_NULL
,
verbose_name
=
_
(
'CertificateTemplate'
),
related_name
=
'classes'
,
related_name
=
'classes_certificate'
,
null
=
True
,
)
receipt_template
=
models
.
ForeignKey
(
'certification.CertificateTemplate'
,
models
.
SET_NULL
,
verbose_name
=
_
(
'CertificateTemplate'
),
related_name
=
'classes_receipt'
,
null
=
True
,
)
...
...
courses/migrations/0032_auto_20210803_0308.py
0 → 100644
View file @
eab22c6a
# Generated by Django 2.2.24 on 2021-08-03 06:08
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'certification'
,
'0008_auto_20210730_1110'
),
(
'courses'
,
'0031_auto_20210730_1115'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'class'
,
name
=
'receipt_template'
,
field
=
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
SET_NULL
,
related_name
=
'classes_receipt'
,
to
=
'certification.CertificateTemplate'
,
verbose_name
=
'CertificateTemplate'
),
),
migrations
.
AlterField
(
model_name
=
'class'
,
name
=
'certificate_template'
,
field
=
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
SET_NULL
,
related_name
=
'classes_certificate'
,
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