<commit_before># -*- coding: utf-8 -*-

from django.contrib import admin
from powerdns.models import (CryptoKey, Domain, DomainMetadata, Record,
                             SuperMaster)


class RecordAdmin(admin.ModelAdmin):
    list_display = ('name', 'type', 'content', 'ttl', 'prio', 'change_date',)
    list_filter = ('type', 'ttl',)
    search_fields = ('name', 'content',)
    readonly_fields = ('change_date', 'ordername',)
    fieldsets = (
        (None, {
            'fields': ('domain', ('type', 'name', 'content',), 'auth',)
        }),
        ('Advanced options', {
            'classes': ('collapse',),
            'fields': ('prio', 'ttl', 'ordername', 'change_date',)
        }),
    )


class DomainAdmin(admin.ModelAdmin):
    list_display = ('name', 'type', 'last_check', 'account',)
    list_filter = ('type', 'last_check', 'account',)
    search_fields = ('name',)
    readonly_fields = ('notified_serial',)


class SuperMasterAdmin(admin.ModelAdmin):
    list_display = ('ip', 'nameserver', 'account',)
    list_filter = ('ip', 'account',)
    search_fields = ('ip', 'nameserver',)


class DomainMetadataAdmin(admin.ModelAdmin):
    list_display = ('domain', 'kind', 'content',)
    list_filter = ('domain', 'kind',)
    search_fields = ('content',)


class CryptoKeyAdmin(admin.ModelAdmin):
    list_display = ('domain', 'flags', 'active', 'content',)
    list_filter = ('domain', 'active',)
    search_fields = ('content',)


admin.site.register(Domain, DomainAdmin)
admin.site.register(Record, RecordAdmin)
admin.site.register(SuperMaster, SuperMasterAdmin)
admin.site.register(DomainMetadata, DomainMetadataAdmin)
admin.site.register(CryptoKey, CryptoKeyAdmin)<commit_msg>usability updates in the admin<commit_after># -*- coding: utf-8 -*-

from django.contrib import admin
from powerdns.models import (CryptoKey, Domain, DomainMetadata, Record,
                             SuperMaster)


class RecordAdmin(admin.ModelAdmin):
    list_display = (
        'name', 'type', 'content', 'domain', 'ttl', 'prio', 'change_date',
    )
    list_filter = ('type', 'ttl', 'domain',)
    search_fields = ('name', 'content',)
    readonly_fields = ('change_date', 'ordername',)
    fieldsets = (
        (None, {
            'fields': ('domain', ('type', 'name', 'content',), 'auth',)
        }),
        ('Advanced options', {
            'classes': ('collapse',),
            'fields': ('prio', 'ttl', 'ordername', 'change_date',)
        }),
    )


class DomainMetadataInline(admin.TabularInline):
    model = DomainMetadata
    extra = 0


class DomainAdmin(admin.ModelAdmin):
    inlines = [DomainMetadataInline]
    list_display = ('name', 'type', 'last_check', 'account',)
    list_filter = ('type', 'last_check', 'account',)
    search_fields = ('name',)
    readonly_fields = ('notified_serial',)


class SuperMasterAdmin(admin.ModelAdmin):
    list_display = ('ip', 'nameserver', 'account',)
    list_filter = ('ip', 'account',)
    search_fields = ('ip', 'nameserver',)


class DomainMetadataAdmin(admin.ModelAdmin):
    list_display = ('domain', 'kind', 'content',)
    list_filter = ('kind', 'domain',)
    search_fields = ('content',)


class CryptoKeyAdmin(admin.ModelAdmin):
    list_display = ('domain', 'flags', 'active', 'content',)
    list_filter = ('active', 'domain',)
    search_fields = ('content',)


admin.site.register(Domain, DomainAdmin)
admin.site.register(Record, RecordAdmin)
admin.site.register(SuperMaster, SuperMasterAdmin)
admin.site.register(DomainMetadata, DomainMetadataAdmin)
admin.site.register(CryptoKey, CryptoKeyAdmin)
{'fraction_non_alphanumeric': 0.17448352875488554, 'fraction_numerical': 0.0008375209380234506, 'mean_word_length': 3.888130968622101, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7103937', 'n_tokens_mistral': 1123, 'n_tokens_neox': 1090, 'n_words': 233}