Commit 61328c8e authored by Matheus Miranda's avatar Matheus Miranda

Merge branch 'develop' into 'master'

New file name field

See merge request !50
parents 7dcbf6fb 6e3701ec
......@@ -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,
)
......
# 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'),
),
]
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment