Commit 0dc09acb authored by Eduardo Nunes's avatar Eduardo Nunes
Browse files

Adding subject and message notification translation

parent 8380b92b
# Generated by Django 2.2.22 on 2021-05-10 18:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('courses', '0023_auto_20210412_1852'),
]
operations = [
migrations.AddField(
model_name='professormessage',
name='message_en',
field=models.TextField(null=True, verbose_name='Message'),
),
migrations.AddField(
model_name='professormessage',
name='message_es',
field=models.TextField(null=True, verbose_name='Message'),
),
migrations.AddField(
model_name='professormessage',
name='message_pt_br',
field=models.TextField(null=True, verbose_name='Message'),
),
migrations.AddField(
model_name='professormessage',
name='subject_en',
field=models.CharField(max_length=255, null=True, verbose_name='Subject'),
),
migrations.AddField(
model_name='professormessage',
name='subject_es',
field=models.CharField(max_length=255, null=True, verbose_name='Subject'),
),
migrations.AddField(
model_name='professormessage',
name='subject_pt_br',
field=models.CharField(max_length=255, null=True, verbose_name='Subject'),
),
]
......@@ -142,8 +142,9 @@ class ProfessorMessageSerializer(serializers.ModelSerializer):
class Meta:
model = ProfessorMessage
fields = ('id', 'course', 'course_name', 'course_slug', 'professor',
'users', 'subject', 'message', 'date', 'is_read', 'groups', 'classes',
'classrooms',
'users', 'subject', 'message','subject_en', 'message_en',
'subject_pt_br', 'message_pt_br', 'subject_es', 'message_es',
'date', 'is_read', 'groups', 'classes', 'classrooms',
)
def get_course_slug(self, obj):
......
from modeltranslation.translator import register, TranslationOptions
from .models import Course, Lesson, Unit
from .models import Course, Lesson, Unit, ProfessorMessage
@register(Course)
......@@ -18,3 +18,7 @@ class LessonTranslationOptions(TranslationOptions):
@register(Unit)
class UnitTranslationOptions(TranslationOptions):
fields = ('title', 'video', 'side_notes', 'chat_room')
@register(ProfessorMessage)
class ProfessorMessageTranslationOptions(TranslationOptions):
fields = ('subject','message')
\ 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