Commit 3a5c476a authored by Matheus Miranda's avatar Matheus Miranda

Merge branch 'develop' into 'master'

Add new translated fields

See merge request !44
parents 6d0eeb46 491056cb
# Generated by Django 2.2.19 on 2021-04-12 14:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('courses', '0021_auto_20210323_1414'),
]
operations = [
migrations.AddField(
model_name='course',
name='description',
field=models.TextField(blank=True, verbose_name='Description'),
),
migrations.AddField(
model_name='course',
name='description_en',
field=models.TextField(blank=True, null=True, verbose_name='Description'),
),
migrations.AddField(
model_name='course',
name='description_es',
field=models.TextField(blank=True, null=True, verbose_name='Description'),
),
migrations.AddField(
model_name='course',
name='description_pt_br',
field=models.TextField(blank=True, null=True, verbose_name='Description'),
),
migrations.AddField(
model_name='course',
name='informations',
field=models.TextField(blank=True, verbose_name='Informations'),
),
migrations.AddField(
model_name='course',
name='informations_en',
field=models.TextField(blank=True, null=True, verbose_name='Informations'),
),
migrations.AddField(
model_name='course',
name='informations_es',
field=models.TextField(blank=True, null=True, verbose_name='Informations'),
),
migrations.AddField(
model_name='course',
name='informations_pt_br',
field=models.TextField(blank=True, null=True, verbose_name='Informations'),
),
migrations.AddField(
model_name='course',
name='language',
field=models.CharField(choices=[('english', 'English'), ('portuguese', 'Portuguese'), ('spanish', 'Spanish')], default='english', max_length=64, verbose_name='Language'),
),
migrations.AddField(
model_name='course',
name='language_en',
field=models.CharField(choices=[('english', 'English'), ('portuguese', 'Portuguese'), ('spanish', 'Spanish')], default='english', max_length=64, null=True, verbose_name='Language'),
),
migrations.AddField(
model_name='course',
name='language_es',
field=models.CharField(choices=[('english', 'English'), ('portuguese', 'Portuguese'), ('spanish', 'Spanish')], default='english', max_length=64, null=True, verbose_name='Language'),
),
migrations.AddField(
model_name='course',
name='language_pt_br',
field=models.CharField(choices=[('english', 'English'), ('portuguese', 'Portuguese'), ('spanish', 'Spanish')], default='english', max_length=64, null=True, verbose_name='Language'),
),
]
......@@ -50,6 +50,12 @@ class Course(models.Model):
('published', _('Published')),
)
LANGUAGES = (
('english', _('English')),
('portuguese', _('Portuguese')),
('spanish', _('Spanish')),
)
slug = models.SlugField(
_('Slug'),
max_length=255,
......@@ -79,6 +85,14 @@ class Course(models.Model):
_('Abstract'),
blank=True,
)
informations = models.TextField(
_('Informations'),
blank=True,
)
description = models.TextField(
_('Description'),
blank=True,
)
structure = models.TextField(
_('Structure'),
blank=True,
......@@ -101,6 +115,12 @@ class Course(models.Model):
default=STATES[0][0],
max_length=64,
)
language = models.CharField(
_('Language'),
choices=LANGUAGES,
default=LANGUAGES[0][0],
max_length=64,
)
thumbnail = models.ImageField(
_('Thumbnail'),
upload_to=hash_name('course_thumbnails', 'name'),
......
......@@ -45,7 +45,8 @@ class CourseSerializer(serializers.ModelSerializer):
'thumbnail_url', 'home_thumbnail_url', 'home_position',
'start_date', 'home_published', 'authors_names', 'has_started',
'min_percent_to_complete', 'is_user_assistant', 'is_user_coordinator',
'is_assistant_or_coordinator', 'professors', 'track', 'forum_id')
'is_assistant_or_coordinator', 'professors', 'track', 'forum_id',
'informations', 'description', 'language', 'course_load')
@staticmethod
def get_home_thumbnail_url(obj):
......
......@@ -7,7 +7,7 @@ class CourseTranslationOptions(TranslationOptions):
fields = ('slug', 'name', 'intro_video', 'application',
'requirement', 'abstract', 'structure', 'workload',
'course_load', 'pronatec', 'thumbnail', 'home_thumbnail',
'min_percent_to_complete')
'min_percent_to_complete', 'informations', 'description', 'language')
@register(Lesson)
......
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