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
61328c8e
Commit
61328c8e
authored
Apr 20, 2021
by
Matheus Miranda
Browse files
Merge branch 'develop' into 'master'
New file name field See merge request
!50
parents
7dcbf6fb
6e3701ec
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
1 deletion
+63
-1
courses/course_material/models.py
courses/course_material/models.py
+6
-1
courses/migrations/0024_auto_20210416_1715.py
courses/migrations/0024_auto_20210416_1715.py
+48
-0
courses/translation.py
courses/translation.py
+9
-0
No files found.
courses/course_material/models.py
View file @
61328c8e
...
...
@@ -28,7 +28,12 @@ def get_upload_path(instance, filename):
class
File
(
models
.
Model
):
# title = models.CharField(_('Title'), max_length=255)
title
=
models
.
CharField
(
_
(
'Title'
),
max_length
=
255
,
blank
=
True
,
null
=
True
)
file
=
models
.
FileField
(
upload_to
=
get_upload_path
,
)
...
...
courses/migrations/0024_auto_20210416_1715.py
0 → 100644
View file @
61328c8e
# Generated by Django 2.2.20 on 2021-04-16 20:15
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'courses'
,
'0023_auto_20210412_1852'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'coursematerial'
,
name
=
'text_en'
,
field
=
models
.
TextField
(
null
=
True
,
verbose_name
=
'Question'
),
),
migrations
.
AddField
(
model_name
=
'coursematerial'
,
name
=
'text_es'
,
field
=
models
.
TextField
(
null
=
True
,
verbose_name
=
'Question'
),
),
migrations
.
AddField
(
model_name
=
'coursematerial'
,
name
=
'text_pt_br'
,
field
=
models
.
TextField
(
null
=
True
,
verbose_name
=
'Question'
),
),
migrations
.
AddField
(
model_name
=
'file'
,
name
=
'title'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
255
,
null
=
True
,
verbose_name
=
'Title'
),
),
migrations
.
AddField
(
model_name
=
'file'
,
name
=
'title_en'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
255
,
null
=
True
,
verbose_name
=
'Title'
),
),
migrations
.
AddField
(
model_name
=
'file'
,
name
=
'title_es'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
255
,
null
=
True
,
verbose_name
=
'Title'
),
),
migrations
.
AddField
(
model_name
=
'file'
,
name
=
'title_pt_br'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
255
,
null
=
True
,
verbose_name
=
'Title'
),
),
]
courses/translation.py
View file @
61328c8e
from
modeltranslation.translator
import
register
,
TranslationOptions
from
.models
import
Course
,
Lesson
,
Unit
from
.course_material.models
import
CourseMaterial
,
File
@
register
(
Course
)
...
...
@@ -18,3 +19,11 @@ class LessonTranslationOptions(TranslationOptions):
@
register
(
Unit
)
class
UnitTranslationOptions
(
TranslationOptions
):
fields
=
(
'title'
,
'video'
,
'side_notes'
,
'chat_room'
)
@
register
(
CourseMaterial
)
class
UnitTranslationOptions
(
TranslationOptions
):
fields
=
(
'text'
,)
@
register
(
File
)
class
UnitTranslationOptions
(
TranslationOptions
):
fields
=
(
'title'
,)
\ No newline at end of file
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