<commit_before>from django.contrib import admin

from api import models


class UserProfileAdmin(admin.ModelAdmin):
    list_display = ('user', 'country', )
    search_fields = ['user__email', 'user__username', 'user__first_name', 'user__last_name']

class EventAdmin(admin.ModelAdmin):
    prepopulated_fields = {'slug': ('title',)}
    list_display = ('title', 'status', 'location', 'country', 'start_date')
    list_editable = ('status',)
    list_filter = ('status', 'start_date')
    filter_horizontal = ('audience',)
    filter_horizontal = ('theme',)

admin.site.register(models.UserProfile, UserProfileAdmin)
admin.site.register(models.Event, EventAdmin)
admin.site.register(models.events.EventAudience)
admin.site.register(models.events.EventTheme)<commit_msg>Make events in the admin searchable by a few fields<commit_after>from django.contrib import admin

from api import models


class UserProfileAdmin(admin.ModelAdmin):
    list_display = ('user', 'country', )
    search_fields = ['user__email', 'user__username', 'user__first_name', 'user__last_name']

class EventAdmin(admin.ModelAdmin):
    search_fields = [
        'title',
        'description',
        'codeweek_for_all_participation_code',
        'creator__email',
        'creator__username',
        'creator__first_name',
        'creator__last_name',
    ]
    prepopulated_fields = {'slug': ('title',)}
    list_display = ('title', 'status', 'location', 'country', 'start_date')
    list_editable = ('status',)
    list_filter = ('status', 'start_date')
    filter_horizontal = ('audience',)
    filter_horizontal = ('theme',)

admin.site.register(models.UserProfile, UserProfileAdmin)
admin.site.register(models.Event, EventAdmin)
admin.site.register(models.events.EventAudience)
admin.site.register(models.events.EventTheme)
{'fraction_non_alphanumeric': 0.13835085777531822, 'fraction_numerical': 0.0, 'mean_word_length': 5.087542087542087, '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': '2518657', 'n_tokens_mistral': 545, 'n_tokens_neox': 543, 'n_words': 104}