<commit_before>from django.contrib import admin
from .models import Facility, Schedule, OpenTime, Category

class OpenTimeInline(admin.TabularInline):
    model = OpenTime
    fk_name = 'schedule'
    max_num = 7

class OpenTimeAdmin(admin.ModelAdmin):
    pass

class FacilityAdmin(admin.ModelAdmin):
    model = Facility
    list_display = ['name', 'location' ]
    list_filter = ['facility_category', ]
    fieldsets = (
        (None, {
             'fields': ('name', 'facility_category',
                       ('location', 'on_campus'),
                       'main_schedule', 'special_schedules',
                       'owners'),
               }),
    )

class ScheduleAdmin(admin.ModelAdmin):
    inlines = [OpenTimeInline, ]
    fieldsets = (
        (None, {
             'fields': ('name',
                       ('valid_start', 'valid_end'),)
               }),
    )

class CategoryAdmin(admin.ModelAdmin):
    pass

admin.site.register(Facility, FacilityAdmin)
admin.site.register(Schedule, ScheduleAdmin)
#admin.site.register(OpenTime, OpenTimeAdmin)
admin.site.register(Category, CategoryAdmin)
<commit_msg>move 'owner' field to collapsed 'advanced' section for facility<commit_after>from django.contrib import admin
from .models import Facility, Schedule, OpenTime, Category

class OpenTimeInline(admin.TabularInline):
    model = OpenTime
    fk_name = 'schedule'
    max_num = 7

class OpenTimeAdmin(admin.ModelAdmin):
    pass

class FacilityAdmin(admin.ModelAdmin):
    model = Facility
    list_display = ['name', 'location' ]
    list_filter = ['facility_category', ]
    fieldsets = (
        (None, {
             'fields': ('name', 'facility_category',
                        ('location', 'on_campus'),
                        'main_schedule', 'special_schedules', ),
        }),
        ('Advanced', {
             'fields': ('owners', ),
             'classes': ('collapse', ),
        }),
    )

class ScheduleAdmin(admin.ModelAdmin):
    inlines = [OpenTimeInline, ]
    fieldsets = (
        (None, {
             'fields': ('name',
                       ('valid_start', 'valid_end'),)
               }),
    )

class CategoryAdmin(admin.ModelAdmin):
    pass

admin.site.register(Facility, FacilityAdmin)
admin.site.register(Schedule, ScheduleAdmin)
#admin.site.register(OpenTime, OpenTimeAdmin)
admin.site.register(Category, CategoryAdmin)

{'fraction_non_alphanumeric': 0.12531539108494533, 'fraction_numerical': 0.0008410428931875525, 'mean_word_length': 2.5507462686567166, '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': '331945', 'n_tokens_mistral': 675, 'n_tokens_neox': 661, 'n_words': 136}