Completed
Push — master ( 3262a6...1cd89d )
by Mathias
40s
created

UacRegAdminForm   A

Size/Duplication

Total Lines 5
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 5
rs 10
1
from django.contrib import admin
2
from django import forms
3
from .models import UacReg, Trusted
4
5
class UacRegAdminForm(forms.ModelForm):
6
7
    class Meta:
8
        model = UacReg
9
        fields = '__all__'
10
11
12
class UacRegAdmin(admin.ModelAdmin):
13
    form = UacRegAdminForm
14
    list_display = ['l_uuid', 'l_username', 'l_domain', 'r_username', 'r_domain', 'realm', 'auth_username', 'auth_password', 'auth_ha1', 'auth_proxy', 'expires', 'flags', 'reg_delay']
15
    readonly_fields = ['l_uuid', 'l_username', 'l_domain', 'r_username', 'r_domain', 'realm', 'auth_username', 'auth_password', 'auth_ha1', 'auth_proxy', 'expires', 'flags', 'reg_delay']
16
17
admin.site.register(UacReg, UacRegAdmin)
18
19
20
class TrustedAdminForm(forms.ModelForm):
21
22
    class Meta:
23
        model = Trusted
24
        fields = '__all__'
25
26
27
class TrustedAdmin(admin.ModelAdmin):
28
    form = TrustedAdminForm
29
    list_display = ['src_ip', 'proto', 'from_pattern', 'ruri_pattern', 'tag', 'priority']
30
    readonly_fields = ['src_ip', 'proto', 'from_pattern', 'ruri_pattern', 'tag', 'priority']
31
32
admin.site.register(Trusted, TrustedAdmin)
33
34
35