<commit_before>from django.contrib import admin
from cfp.models import CallForPaper, PaperApplication, Applicant
from django.core import urlresolvers


class ApplicantAdmin(admin.ModelAdmin):
    raw_id_fields = ('user', )
    list_display = ('user', 'full_name', 'about', 'biography', 'speaker_experience', 'github', 'twitter')
    fields = ('user', 'about', 'biography', 'speaker_experience', 'image')

    def get_readonly_fields(self, request, obj=None):
        if obj:
            return self.readonly_fields + ('user',)
        return self.readonly_fields

class PaperApplicationAdmin(admin.ModelAdmin):
    list_display = ('title', 'link_to_applicant', 'about', 'abstract', 'skill_level', 'duration')
    readonly_fields = ('cfp', 'applicant')
    fields = ('cfp', 'applicant', 'title', 'about', 'abstract', 'skill_level', 'duration')
<commit_msg>Add exclude option to application admin<commit_after>from django.contrib import admin
from cfp.models import CallForPaper, PaperApplication, Applicant
from django.core import urlresolvers


def mark_as_excluded(modeladmin, request, queryset):
    queryset.update(exclude=True)


class ApplicantAdmin(admin.ModelAdmin):
    raw_id_fields = ('user', )
    list_display = ('user', 'full_name', 'about', 'biography', 'speaker_experience', 'github', 'twitter')
    fields = ('user', 'about', 'biography', 'speaker_experience', 'image')

    def get_readonly_fields(self, request, obj=None):
        if obj:
            return self.readonly_fields + ('user',)
        return self.readonly_fields


class PaperApplicationAdmin(admin.ModelAdmin):
    list_display = ('title', 'link_to_applicant', 'about', 'abstract', 'skill_level', 'duration', 'exclude')
    readonly_fields = ('cfp', 'applicant')
    fields = ('cfp', 'applicant', 'title', 'about', 'abstract', 'skill_level', 'duration')
    actions = [mark_as_excluded]

{'fraction_non_alphanumeric': 0.1449197860962567, 'fraction_numerical': 0.0, 'mean_word_length': 5.1749174917491745, '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': '5232841', 'n_tokens_mistral': 580, 'n_tokens_neox': 553, 'n_words': 139}