admin.py 827 Bytes
Newer Older
Thom Wiggers's avatar
Thom Wiggers committed
1
from django.contrib import admin
2
from utils.translation import TranslatedModelAdmin
Thom Wiggers's avatar
Thom Wiggers committed
3
4
5

from . import models

6

Thom Wiggers's avatar
Thom Wiggers committed
7
@admin.register(models.Committee)
8
class CommitteeAdmin(TranslatedModelAdmin):
Thom Wiggers's avatar
Thom Wiggers committed
9
10
    list_filter = ('until',)

11
12
    fields = ('name', 'description', 'photo', 'permissions',
              'since', 'until',)
13

Thom Wiggers's avatar
Thom Wiggers committed
14
15
16
17
18
19
    def get_queryset(self, request):
        qs = super().get_queryset(request)
        return qs.exclude(board__is_board=True)


@admin.register(models.Board)
20
class BoardAdmin(TranslatedModelAdmin):
Thom Wiggers's avatar
Thom Wiggers committed
21
    exclude = ('is_board',)
Thom Wiggers's avatar
Thom Wiggers committed
22

23
24
    fields = ('name', 'description', 'photo', 'permissions',
              'since', 'until',)
25

Thom Wiggers's avatar
Thom Wiggers committed
26
27

@admin.register(models.CommitteeMembership)
28
class CommitteeMembershipAdmin(TranslatedModelAdmin):
Thom Wiggers's avatar
Thom Wiggers committed
29
    pass
30
31
32
33
34


@admin.register(models.Mentorship)
class MentorsAdmin(admin.ModelAdmin):
    pass