<commit_before># ensure celery autodiscovery runs
from djcelery import admin as celery_admin

from djcelery.models import (
    TaskState, WorkerState, PeriodicTask, IntervalSchedule, CrontabSchedule)

from django.contrib import admin
from django.contrib.sites.models import Site

from unicoremc.models import Project, Localisation, AppType
from unicoremc.states import ProjectWorkflow

from ostinato.statemachine.forms import sm_form_factory


class ProjectAdmin(admin.ModelAdmin):
    form = sm_form_factory(ProjectWorkflow)

    list_filter = ('state',)
    list_display = (
        'application_type', 'country', 'state', 'base_repo_url', 'repo_url')
    readonly_fields = (
        'application_type', 'base_repo_url', 'country', 'repo_url', 'owner',
        'available_languages')


admin.site.register(Localisation, admin.ModelAdmin)
admin.site.register(AppType, admin.ModelAdmin)
admin.site.register(Project, ProjectAdmin)

# remove celery from admin
admin.site.unregister(Site)
admin.site.unregister(TaskState)
admin.site.unregister(WorkerState)
admin.site.unregister(IntervalSchedule)
admin.site.unregister(CrontabSchedule)
admin.site.unregister(PeriodicTask)
<commit_msg>add more fields to django admin for project<commit_after># ensure celery autodiscovery runs
from djcelery import admin as celery_admin

from djcelery.models import (
    TaskState, WorkerState, PeriodicTask, IntervalSchedule, CrontabSchedule)

from django.contrib import admin
from django.contrib.sites.models import Site

from unicoremc.models import Project, Localisation, AppType
from unicoremc.states import ProjectWorkflow

from ostinato.statemachine.forms import sm_form_factory


class ProjectAdmin(admin.ModelAdmin):
    form = sm_form_factory(ProjectWorkflow)

    search_fields = (
        'state', 'country', 'application_type__name',
        'application_type__title', 'application_type__project_type')
    list_filter = ('state', 'application_type')
    list_display = (
        'application_type', 'country', 'state', 'base_repo_url', 'repo_url')
    readonly_fields = (
        'application_type', 'base_repo_url', 'country', 'repo_url', 'owner',
        'available_languages')


admin.site.register(Localisation, admin.ModelAdmin)
admin.site.register(AppType, admin.ModelAdmin)
admin.site.register(Project, ProjectAdmin)

# remove celery from admin
admin.site.unregister(Site)
admin.site.unregister(TaskState)
admin.site.unregister(WorkerState)
admin.site.unregister(IntervalSchedule)
admin.site.unregister(CrontabSchedule)
admin.site.unregister(PeriodicTask)

{'fraction_non_alphanumeric': 0.09577795152462862, 'fraction_numerical': 0.0, 'mean_word_length': 5.86058981233244, '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': '4075745', 'n_tokens_mistral': 760, 'n_tokens_neox': 758, 'n_words': 166}