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')

    def link_to_applicant(self, obj):
        link = urlresolvers.reverse("admin:cfp_applicant_change", args=[obj.applicant.id])
        return u'<a href="%s">%s</a>' % (link, obj.applicant)
    link_to_applicant.allow_tags = True

admin.site.register(CallForPaper)
admin.site.register(Applicant, ApplicantAdmin)
admin.site.register(PaperApplication, PaperApplicationAdmin)

@@ -130,16 +130,105 @@
 lvers%0A%0A%0A
+def mark_as_excluded(modeladmin, request, queryset):%0A    queryset.update(exclude=True)%0A%0A%0A
 class Ap
@@ -631,16 +631,17 @@
 fields%0A%0A
+%0A
 class Pa
@@ -775,16 +775,27 @@
 uration'
+, 'exclude'
 )%0A    re
@@ -921,16 +921,49 @@
 ration')
+%0A    actions = %5Bmark_as_excluded%5D
 %0A%0A    de

Add exclude option to application admin