<commit_before>from django.contrib import admin
from cms.admin import ContentManageableModelAdmin

from .models import Calendar, EventCategory, Event, OccurringRule, RecurringRule, Alarm, EventLocation


class EventInline(admin.StackedInline):
    model = Event
    extra = 0


class CalendarAdmin(ContentManageableModelAdmin):
    inlines = [EventInline]


class OccurringRuleInline(admin.StackedInline):
    model = OccurringRule
    extra = 0
    max_num = 1


class RecurringRuleInline(admin.StackedInline):
    model = RecurringRule
    extra = 0


class AlarmInline(admin.StackedInline):
    model = Alarm
    extra = 0


class EventAdmin(ContentManageableModelAdmin):
    inlines = [OccurringRuleInline, RecurringRuleInline, AlarmInline]


admin.site.register(Calendar, CalendarAdmin)
admin.site.register(EventCategory, ContentManageableModelAdmin)
admin.site.register(Event, EventAdmin)
admin.site.register(OccurringRule)
admin.site.register(RecurringRule)
admin.site.register(Alarm, ContentManageableModelAdmin)
admin.site.register(EventLocation)<commit_msg>Making events admin more useful<commit_after>from django.contrib import admin
from cms.admin import ContentManageableModelAdmin

from .models import Calendar, EventCategory, Event, OccurringRule, RecurringRule, Alarm, EventLocation


class EventInline(admin.StackedInline):
    model = Event
    extra = 0


class CalendarAdmin(ContentManageableModelAdmin):
    inlines = [EventInline]


class OccurringRuleInline(admin.StackedInline):
    model = OccurringRule
    extra = 0
    max_num = 1


class RecurringRuleInline(admin.StackedInline):
    model = RecurringRule
    extra = 0


class AlarmInline(admin.StackedInline):
    model = Alarm
    extra = 0


class EventAdmin(ContentManageableModelAdmin):
    inlines = [OccurringRuleInline, RecurringRuleInline, AlarmInline]
    list_display = ['__str__', 'calendar', 'featured']
    list_filter = ['calendar', 'featured']

admin.site.register(Calendar, CalendarAdmin)
admin.site.register(EventCategory, ContentManageableModelAdmin)
admin.site.register(Event, EventAdmin)
admin.site.register(OccurringRule)
admin.site.register(RecurringRule)
admin.site.register(Alarm, ContentManageableModelAdmin)
admin.site.register(EventLocation)
{'fraction_non_alphanumeric': 0.082258781680747, 'fraction_numerical': 0.004446420631391729, 'mean_word_length': 5.7975830815709966, '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': '6669019', 'n_tokens_mistral': 692, 'n_tokens_neox': 686, 'n_words': 140}