summaryrefslogtreecommitdiff
path: root/releng/admin.py
blob: 9c93c4bedf6a59ea44408c63b3d297e7a7d62c7b (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
34
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')
    readonly_fields = ('created', 'last_modified')


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: