<commit_before>from django.contrib import admin

from . import models


@admin.register(models.OfficeHours)
class OfficeHoursAdmin(admin.ModelAdmin):
    list_display = ('user', '__str__', 'expires_on', 'created_on')
    search_fields = ('user__email', 'user__first_name', 'user__last_name')
    raw_id_fields = ('user', )


@admin.register(models.Course)
class CourseAdmin(admin.ModelAdmin):
    list_display = ('code', 'full_name', 'name', 'start_time', 'location')<commit_msg>add user fields to officehours admin<commit_after>from django.contrib import admin

from . import models


@admin.register(models.OfficeHours)
class OfficeHoursAdmin(admin.ModelAdmin):
    list_display = (
        'email', 'full_name', '__str__',
        'expires_on', 'created_on'
    )
    search_fields = ('user__email', 'user__first_name', 'user__last_name')
    raw_id_fields = ('user', )

    def email(self, obj):
        return obj.user.email

    def full_name(self, obj):
        return obj.user.get_full_name()


@admin.register(models.Course)
class CourseAdmin(admin.ModelAdmin):
    list_display = ('code', 'full_name', 'name', 'start_time', 'location')
{'fraction_non_alphanumeric': 0.1388646288209607, 'fraction_numerical': 0.0, 'mean_word_length': 4.817258883248731, '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': '5983646', 'n_tokens_mistral': 378, 'n_tokens_neox': 366, 'n_words': 75}