<commit_before>from django.contrib import admin

from .models import Entry, Event


class EntryAdmin(admin.ModelAdmin):
    list_display = ('headline', 'pub_date', 'is_active', 'is_published', 'author')
    list_filter = ('is_active',)
    exclude = ('summary_html', 'body_html')
    prepopulated_fields = {"slug": ("headline",)}

    def formfield_for_dbfield(self, db_field, **kwargs):
        formfield = super(EntryAdmin, self).formfield_for_dbfield(db_field, **kwargs)
        if db_field.name == 'body':
            formfield.widget.attrs['rows'] = 25
        return formfield


class EventAdmin(admin.ModelAdmin):
    list_display = ('headline', 'external_url', 'date', 'location', 'pub_date', 'is_active', 'is_published')
    list_filter = ('is_active',)


admin.site.register(Entry, EntryAdmin)
admin.site.register(Event, EventAdmin)<commit_msg>Used monospace font for blog entry widget.<commit_after>from django.contrib import admin

from .models import Entry, Event


class EntryAdmin(admin.ModelAdmin):
    list_display = ('headline', 'pub_date', 'is_active', 'is_published', 'author')
    list_filter = ('is_active',)
    exclude = ('summary_html', 'body_html')
    prepopulated_fields = {"slug": ("headline",)}

    def formfield_for_dbfield(self, db_field, **kwargs):
        formfield = super(EntryAdmin, self).formfield_for_dbfield(db_field, **kwargs)
        if db_field.name == 'body':
            formfield.widget.attrs.update({
                'rows': 60,
                'style': 'font-family: monospace; width: 810px;',
            })
        return formfield


class EventAdmin(admin.ModelAdmin):
    list_display = ('headline', 'external_url', 'date', 'location', 'pub_date', 'is_active', 'is_published')
    list_filter = ('is_active',)


admin.site.register(Entry, EntryAdmin)
admin.site.register(Event, EventAdmin)
{'fraction_non_alphanumeric': 0.1444082519001086, 'fraction_numerical': 0.003800217155266015, 'mean_word_length': 4.176966292134831, 'pattern_counts': {'":': 2, '<': 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': '3772215', 'n_tokens_mistral': 588, 'n_tokens_neox': 570, 'n_words': 123}