<commit_before>from django.contrib import admin

from nomadblog.models import BlogHub, Blog, Category, BlogUser, Country


class CountryAdmin(admin.ModelAdmin):
    list_display = ('code', 'name')
    search_fields = ('code', 'name')


class BlogHubAdmin(admin.ModelAdmin):
    list_display = ('name', )
    search_fields = ('name', )


class BlogAdmin(admin.ModelAdmin):
    list_display = ('title', 'slug', 'description')
    search_fields = ('title', 'slug', 'description')
    prepopulated_fields = {'slug': ('title',)}


class BlogUserAdmin(admin.ModelAdmin):
    list_display = ('user', 'blog', 'bio')
    search_fields = ('user__username', 'user__email', 'blog__title', 'bio')


class CategoryAdmin(admin.ModelAdmin):
    list_display = ('name', 'slug')
    search_fields = ('name', 'slug')
    prepopulated_fields = {'slug': ('name',)}


admin.site.register(Country, CountryAdmin)
admin.site.register(BlogHub, BlogHubAdmin)
admin.site.register(Blog, BlogAdmin)
admin.site.register(Category, CategoryAdmin)
admin.site.register(BlogUser, BlogUserAdmin)<commit_msg>Show blog user name field in admin<commit_after>from django.contrib import admin

from nomadblog.models import BlogHub, Blog, Category, BlogUser, Country


class CountryAdmin(admin.ModelAdmin):
    list_display = ('code', 'name')
    search_fields = ('code', 'name')


class BlogHubAdmin(admin.ModelAdmin):
    list_display = ('name', )
    search_fields = ('name', )


class BlogAdmin(admin.ModelAdmin):
    list_display = ('title', 'slug', 'description')
    search_fields = ('title', 'slug', 'description')
    prepopulated_fields = {'slug': ('title',)}


class BlogUserAdmin(admin.ModelAdmin):
    list_display = ('user', 'blog', 'name', 'bio')
    search_fields = ('user__username', 'user__email', 'blog__title', 'name', 'bio')


class CategoryAdmin(admin.ModelAdmin):
    list_display = ('name', 'slug')
    search_fields = ('name', 'slug')
    prepopulated_fields = {'slug': ('name',)}


admin.site.register(Country, CountryAdmin)
admin.site.register(BlogHub, BlogHubAdmin)
admin.site.register(Blog, BlogAdmin)
admin.site.register(Category, CategoryAdmin)
admin.site.register(BlogUser, BlogUserAdmin)
{'fraction_non_alphanumeric': 0.15617822691777675, 'fraction_numerical': 0.0, 'mean_word_length': 5.54054054054054, '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': '6393226', 'n_tokens_mistral': 677, 'n_tokens_neox': 669, 'n_words': 149}