<commit_before>from django.contrib import admin

from ella.ellaadmin.options import EllaAdminOptionsMixin
from ella.media.models import Media, Section, Usage
from ella.media.forms import MediaForm

class SectionInline(admin.TabularInline):
    model = Section

class UsageInline(admin.TabularInline):
    model = Usage

class MediaOptions(EllaAdminOptionsMixin, admin.ModelAdmin):

    def __init__(self, *args, **kwargs):
        super(MediaOptions, self).__init__(*args, **kwargs)
        self.form = MediaForm

    prepopulated_fields = {'slug' : ('title',)}

    list_display = ('title',)
    list_filter = ('created', 'updated',)
    search_fields = ('title', 'slug', 'description', 'content',)

#    inlines = (PlacementInlineOptions, TaggingInlineOptions, SectionInline)
    inlines = (SectionInline, UsageInline)

    rich_text_fields = {None: ('description', 'text',)}


admin.site.register(Media, MediaOptions)

<commit_msg>- More section inlines for media<commit_after>from django.contrib import admin

from ella.ellaadmin.options import EllaAdminOptionsMixin
from ella.media.models import Media, Section, Usage
from ella.media.forms import MediaForm

class SectionInline(admin.TabularInline):
    model = Section
    extra = 5

class UsageInline(admin.TabularInline):
    model = Usage

class MediaOptions(EllaAdminOptionsMixin, admin.ModelAdmin):

    def __init__(self, *args, **kwargs):
        super(MediaOptions, self).__init__(*args, **kwargs)
        self.form = MediaForm

    prepopulated_fields = {'slug' : ('title',)}

    list_display = ('title',)
    list_filter = ('created', 'updated',)
    search_fields = ('title', 'slug', 'description', 'content',)

#    inlines = (PlacementInlineOptions, TaggingInlineOptions, SectionInline)
    inlines = (SectionInline, UsageInline)

    rich_text_fields = {None: ('description', 'text',)}


admin.site.register(Media, MediaOptions)


{'fraction_non_alphanumeric': 0.12204103103629668, 'fraction_numerical': 0.0005260389268805891, 'mean_word_length': 4.798780487804878, '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': '5282289', 'n_tokens_mistral': 569, 'n_tokens_neox': 569, 'n_words': 135}