translation.py 966 Bytes
Newer Older
1 2
from modeltranslation.translator import register, TranslationOptions
from .models import Course, Lesson, Unit
Glaucia S. Santos's avatar
Glaucia S. Santos committed
3
from .course_material.models import CourseMaterial, File
4 5 6 7 8 9 10


@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
11
              'min_percent_to_complete', 'informations', 'description')
12 13 14 15 16 17 18 19 20 21


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


@register(Unit)
class UnitTranslationOptions(TranslationOptions):
    fields = ('title', 'video', 'side_notes', 'chat_room')
Glaucia S. Santos's avatar
Glaucia S. Santos committed
22 23 24 25 26 27 28

@register(CourseMaterial)
class UnitTranslationOptions(TranslationOptions):
    fields = ('text',)

@register(File)
class UnitTranslationOptions(TranslationOptions):
Glaucia S. Santos's avatar
Glaucia S. Santos committed
29
    fields = ('title', 'file')