summaryrefslogtreecommitdiff
path: root/packages/admin.py
blob: 51c6fb0637889d169ba05bda2b22f6d93286c341 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from django.contrib import admin

from .models import (PackageRelation, FlagRequest,
        Signoff, SignoffSpecification, Update)

class PackageRelationAdmin(admin.ModelAdmin):
    list_display = ('pkgbase', 'user', 'type', 'created')
    list_filter = ('type', 'user')
    search_fields = ('pkgbase', 'user__username')
    ordering = ('pkgbase', 'user')
    date_hierarchy = 'created'


class FlagRequestAdmin(admin.ModelAdmin):
    list_display = ('pkgbase', 'version', 'repo', 'created', 'who', 'is_spam',
            'is_legitimate', 'message')
    list_filter = ('is_spam', 'is_legitimate', 'repo')
    search_fields = ('pkgbase', 'user_email', 'message')
    ordering = ('-created',)
    date_hierarchy = 'created'


class SignoffAdmin(admin.ModelAdmin):
    list_display = ('pkgbase', 'full_version', 'arch', 'repo',
            'user', 'created', 'revoked')
    list_filter = ('arch', 'repo', 'user')
    search_fields = ('pkgbase', 'user__username')
    ordering = ('-created',)
    date_hierarchy = 'created'

class SignoffSpecificationAdmin(admin.ModelAdmin):
    list_display = ('pkgbase', 'full_version', 'arch', 'repo',
            'user', 'created', 'comments')
    list_filter = ('arch', 'repo', 'user')
    search_fields = ('pkgbase', 'user__username')
    ordering = ('-created',)
    date_hierarchy = 'created'


class UpdateAdmin(admin.ModelAdmin):
    list_display = ('pkgname', 'repo', 'arch', 'action_flag',
            'old_version', 'new_version', 'created')
    list_filter = ('action_flag', 'repo', 'arch')
    search_fields = ('pkgname',)
    ordering = ('-created',)
    date_hierarchy = 'created'
    raw_id_fields = ('package',)


admin.site.register(PackageRelation, PackageRelationAdmin)
admin.site.register(FlagRequest, FlagRequestAdmin)
admin.site.register(Signoff, SignoffAdmin)
admin.site.register(SignoffSpecification, SignoffSpecificationAdmin)
admin.site.register(Update, UpdateAdmin)

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