summaryrefslogtreecommitdiff
path: root/releng/admin.py
blob: c7e6396ecfd1376a9055ef5de43e5673d2fb1a00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from django.contrib import admin

from .models import (Architecture, BootType, Bootloader, ClockChoice,
        Filesystem, HardwareType, InstallType, Iso, IsoType, Module, Source,
        Test, Release)

class IsoAdmin(admin.ModelAdmin):
    list_display = ('name', 'created', 'active', 'removed')
    list_filter = ('active', 'created')
    date_hierarchy = 'created'

class TestAdmin(admin.ModelAdmin):
    list_display = ('user_name', 'user_email', 'created', 'ip_address',
            'iso', 'success')
    list_filter = ('success', 'iso')

class ReleaseAdmin(admin.ModelAdmin):
    list_display = ('version', 'release_date', 'kernel_version', 'available',
            'created')
    list_filter = ('available', 'release_date')


SIMPLE_MODELS = (Architecture, BootType, Bootloader, ClockChoice, Filesystem,
        HardwareType, InstallType, IsoType, Module, Source)

for model in SIMPLE_MODELS:
    admin.site.register(model)

admin.site.register(Iso, IsoAdmin)
admin.site.register(Test, TestAdmin)
admin.site.register(Release, ReleaseAdmin)

# vim: set ts=4 sw=4 et: