<commit_before>from django import forms
from django.contrib import admin
from api.models import AuthEvent, UserData, ACL
from authmethods.models import Message, ColorList
from authmethods import METHODS

# Register your models here.

class AuthEventAdminForm(forms.ModelForm):
    class Meta:
        model = AuthEvent
        fields = ('name', 'auth_method', 'auth_method_config', 'metadata')
        choices = []
        for k in METHODS.keys():
            choices.append((k, k + ': ' + METHODS.get(k).DESCRIPTION))

        widgets = {
                'auth_method':
                forms.Select(attrs={'obj':'str'}, choices=choices),
        }

class AuthEventAdmin(admin.ModelAdmin):
    form = AuthEventAdminForm


class UserDataAdmin(admin.ModelAdmin):
    pass


class ACLAdmin(admin.ModelAdmin):
    pass


class ColorListAdmin(admin.ModelAdmin):
    pass


class MessageAdmin(admin.ModelAdmin):
    pass


admin.site.register(AuthEvent, AuthEventAdmin)
admin.site.register(UserData, UserDataAdmin)
admin.site.register(ACL, ACLAdmin)
admin.site.register(ColorList, ColorListAdmin)
admin.site.register(Message, MessageAdmin)
<commit_msg>Added Code and Connection to admin<commit_after>from django import forms
from django.contrib import admin
from api.models import AuthEvent, UserData, ACL
from authmethods.models import Message, ColorList, Code, Connection
from authmethods import METHODS

# Register your models here.

class AuthEventAdminForm(forms.ModelForm):
    class Meta:
        model = AuthEvent
        fields = ('name', 'auth_method', 'auth_method_config', 'metadata')
        choices = []
        for k in METHODS.keys():
            choices.append((k, k + ': ' + METHODS.get(k).DESCRIPTION))

        widgets = {
                'auth_method':
                forms.Select(attrs={'obj':'str'}, choices=choices),
        }

class AuthEventAdmin(admin.ModelAdmin):
    form = AuthEventAdminForm


class UserDataAdmin(admin.ModelAdmin):
    pass


class ACLAdmin(admin.ModelAdmin):
    pass


class ColorListAdmin(admin.ModelAdmin):
    pass


class MessageAdmin(admin.ModelAdmin):
    pass


class CodeAdmin(admin.ModelAdmin):
    pass


class ConnectionAdmin(admin.ModelAdmin):
    pass


admin.site.register(AuthEvent, AuthEventAdmin)
admin.site.register(UserData, UserDataAdmin)
admin.site.register(ACL, ACLAdmin)
admin.site.register(ColorList, ColorListAdmin)
admin.site.register(Message, MessageAdmin)
admin.site.register(Code, CodeAdmin)
admin.site.register(Connection, ConnectionAdmin)

{'fraction_non_alphanumeric': 0.1025844930417495, 'fraction_numerical': 0.0, 'mean_word_length': 3.801526717557252, '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': '6396287', 'n_tokens_mistral': 746, 'n_tokens_neox': 703, 'n_words': 169}