translation.py 854 Bytes
Newer Older
1
from modeltranslation.translator import register, TranslationOptions
2
from .models import Course, Lesson, Unit, ProfessorMessage
3 4 5 6 7 8 9


@register(Course)
class CourseTranslationOptions(TranslationOptions):
    fields = ('slug', 'name', 'intro_video', 'application',
              'requirement', 'abstract', 'structure', 'workload',
              'course_load', 'pronatec', 'thumbnail', 'home_thumbnail',
Glaucia S. Santos's avatar
Glaucia S. Santos committed
10
              'min_percent_to_complete', 'informations', 'description')
11 12 13 14 15 16 17 18 19 20


@register(Lesson)
class LessonTranslationOptions(TranslationOptions):
    fields = ('desc', 'name', 'notes', 'slug', 'thumbnail')


@register(Unit)
class UnitTranslationOptions(TranslationOptions):
    fields = ('title', 'video', 'side_notes', 'chat_room')
21 22 23 24

@register(ProfessorMessage)
class ProfessorMessageTranslationOptions(TranslationOptions):
    fields = ('subject','message')