Commit 6a1283d9 authored by Thom Wiggers's avatar Thom Wiggers 📐

Merge branch 'feature/education-filter-search' into 'master'

Improve education app translation, filtering and searching

See merge request !381
parents 4fde5665 22479ddb
......@@ -15,13 +15,16 @@ admin.site.register(models.Category)
class CourseAdmin(TranslatedModelAdmin):
fields = ('name', 'shorthand', 'course_code', 'ec', 'since', 'until',
'period', 'categories', 'old_courses')
list_filter = ('categories', 'ec')
search_fields = ('name', 'course_code')
@admin.register(models.Exam)
class ExamAdmin(TranslatedModelAdmin):
list_display = ('type', 'course', 'exam_date', 'uploader',
'accepted')
list_filter = ('accepted', 'exam_date', 'type')
list_filter = ('accepted', 'exam_date', 'type',)
search_fields = ('course', 'uploader',)
actions = ['accept', 'reject']
def accept(self, request, queryset):
......@@ -39,6 +42,7 @@ class ExamAdmin(TranslatedModelAdmin):
class SummaryAdmin(TranslatedModelAdmin):
list_display = ('name', 'course', 'uploader', 'accepted')
list_filter = ('accepted',)
search_fields = ('name', 'course', 'uploader',)
actions = ['accept', 'reject']
def accept(self, request, queryset):
......
......@@ -78,7 +78,7 @@ class Course(models.Model, metaclass=ModelTranslateMeta):
verbose_name_plural = _('courses')
class Exam(models.Model):
class Exam(models.Model, metaclass=ModelTranslateMeta):
EXAM_TYPES = (
('document', _('Document')),
('exam', _('Exam')),
......@@ -146,7 +146,7 @@ class Exam(models.Model):
verbose_name_plural = _('exams')
class Summary(models.Model):
class Summary(models.Model, metaclass=ModelTranslateMeta):
name = models.CharField(
max_length=255,
verbose_name=_('summary name'),
......
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