from __future__ import absolute_import
from __future__ import unicode_literals
from django.contrib import admin
from corehq.apps.data_interfaces.models import DomainCaseRuleRun, CaseRuleSubmission


class DomainCaseRuleRunAdmin(admin.ModelAdmin):

    list_display = [
        'domain',
        'started_on',
        'finished_on',
        'status',
        'cases_checked',
        'num_updates',
        'num_closes',
        'num_related_updates',
        'num_related_closes',
        'dbs_completed',
    ]

    search_fields = [
        'domain',
    ]

    ordering = ['-started_on']


class CaseRuleSubmissionAdmin(admin.ModelAdmin):

    list_display = [
        'domain',
        'rule',
        'created_on',
        'form_id',
        'archived',
    ]

    search_fields = [
        'domain',
    ]

    ordering = ['-created_on']


admin.site.register(DomainCaseRuleRun, DomainCaseRuleRunAdmin)
admin.site.register(CaseRuleSubmission, CaseRuleSubmissionAdmin)

@@ -791,32 +791,51 @@
       'domain',%0A
+        'form_id',%0A
     %5D%0A%0A    order

Add form_id to CaseRuleSubmission admin searchable fields