# coding: utf-8 
# AUTOGENERATED BY gen_script.sh from kp1.py
# Copyright (C) Nyimbi Odero, Thu Aug  3 20:34:20 EAT 2017
 
 
import calendar
from flask import redirect, flash, url_for, Markup
from flask import render_template
from flask_appbuilder.models.sqla.interface import SQLAInterface
from flask_appbuilder.views import ModelView, BaseView, MasterDetailView, MultipleView, RestCRUDView, CompactCRUDMixin
from flask_appbuilder import ModelView, CompactCRUDMixin, aggregate_count, action, expose, BaseView, has_access
from flask_appbuilder.charts.views import ChartView, TimeChartView, GroupByChartView
from flask_appbuilder.models.group import aggregate_count
from flask_appbuilder.widgets import ListThumbnail, ListWidget
from flask_appbuilder.widgets import FormVerticalWidget, FormInlineWidget, FormHorizontalWidget, ShowBlockWidget
from flask_appbuilder.models.sqla.filters import FilterStartsWith, FilterEqualFunction as FA
from app import appbuilder, db
 
 
from .models import *
 
 
 
# Basic Lists 
hide_list = ['created_by', 'changed_by', 'created_on', 'changed_on'] 
 
 
#To pretty Print from PersonMixin 
def pretty_month_year(value):
    return calendar.month_name[value.month] + ' ' + str(value.year)
 
 
def pretty_year(value):
    return str(value.year)
 
 
def fill_gender():
  try:
      db.session.add(Gender(name='Male'))
      db.session.add(Gender(name='Female'))
      db.session.commit()
  except:
      db.session.rollback()

class LawyerView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Lawyer, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class PolicemanView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Policeman, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class BailView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Bail, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class CaseView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Case, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class CasecategoryView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Casecategory, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class CauseofactionView(CompactCRUDMixin, ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Causeofaction, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class CommitaltypeView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Commitaltype, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class ConstituencyView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Constituency, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class CountyView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(County, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class CourtView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Court, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class CourtlevelView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Courtlevel, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class CourtstationView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Courtstation, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class DefendantView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Defendant, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class DoctemplateView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Doctemplate, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class DocumentView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Document, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class FilingView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Filing, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class FilingtypeView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Filingtype, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class GenderView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Gender, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class HearingView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Hearing, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class HearingtypeView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Hearingtype, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class InvestigationView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Investigation, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class JoRankView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(JoRank, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class JudicialofficerView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Judicialofficer, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class LawfirmView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Lawfirm, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class NatureofsuitView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Natureofsuit, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class PaymentView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Payment, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class PaymentmethodView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Paymentmethod, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class PlaintiffView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Plaintiff, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class PolicerankView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Policerank, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class PoliceroleView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Policerole, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class PolicestationView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Policestation, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class PolicestationtypeView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Policestationtype, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class PrisonView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Prison, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class PrisoncommitalView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Prisoncommital, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class ProsecutorView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Prosecutor, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class ProsecutorteamView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Prosecutorteam, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class SubcountyView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Subcounty, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class SuretyView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Surety, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class TownView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Town, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    



class WitnesView(ModelView):#MasterDetailView, MultipleView
    datamodel=SQLAInterface(Witnes, db.session)
    #add_title =
    #list_title =
    #edit_title =
    #show_title =
    #add_widget = (FormVerticalWidget|FormInlineWidget)
    #show_widget = ShowBlockWidget
    #list_widget = (ListThumbnail|ListWidget)
    #base_order = ("name", "asc")
    search_exclude_columns = person_exclude_columns + biometric_columns + person_search_exclude_columns
    add_exclude_columns = edit_exclude_columns = audit_exclude_columns
    #label_columns = {"contact_group":"Contacts Group"} 
    #add_columns = person_list_columns + ref_columns + contact_columns
    #edit_columns = person_list_columns + ref_columns + contact_columns
    #list_columns = person_list_columns + ref_columns + contact_columns
    #list_widget = ListBlock|ListItem|ListThumbnail|ListWidget (default)
    #related_views =[]
    #show_fieldsets = person_show_fieldset + contact_fieldset
    #edit_fieldsets = add_fieldsets = \ 
			# ref_fieldset + person_fieldset + contact_fieldset #+  activity_fieldset + place_fieldset + biometric_fieldset + employment_fieldset
    #description_columns = {"name":"your models name column","address":"the address column"}
    #show_template = "appbuilder/general/model/show_cascade.html"
    #edit_template = "appbuilder/general/model/edit_cascade.html"


    @action("muldelete", "Delete", Markup("<p>Delete all Really?</p><p>Ok then...</p>"), "fa-rocket")
    def muldelete(self, items):
        self.datamodel.delete_all(items)
        self.update_redirect()
        return redirect(self.get_redirect())
    


 
class AttorneyChartView(GroupByChartView):
    datamodel = SQLAInterface(Attorney , db.session)
    chart_title = 'Grouped Attorney by Birth'
    label_columns = AttorneyView.label_columns
    chart_type = 'PieChart'
 
    definitions = [
        {
            'group' : 'age_today',
            "series" : [(aggregate_count,"age_today")]
        },
        {
            'group' : 'gender',
            "series" : [(aggregate_count,"age_today")]
        }
    ]
 
 
class AttorneyTimeChartView(GroupByChartView):
    datamodel = SQLAInterface(Attorney , db.session)
 
    chart_title = 'Grouped Birth Attorney'
    chart_type = 'AreaChart'
    label_columns = AttorneyView.label_columns
    definitions = [
        {
            'group' : 'age_today',
            'formatter': pretty_month_year,
            "series" : [(aggregate_count,"age_today")]
        },
        {
            'group': 'age_today',
            'formatter': pretty_year,
            "series" : [(aggregate_count,"age_today")]
        }
    ]


 
class PlaintiffChartView(GroupByChartView):
    datamodel = SQLAInterface(Plaintiff , db.session)
    chart_title = 'Grouped Plaintiff by Birth'
    label_columns = PlaintiffView.label_columns
    chart_type = 'PieChart'
 
    definitions = [
        {
            'group' : 'age_today',
            "series" : [(aggregate_count,"age_today")]
        },
        {
            'group' : 'gender',
            "series" : [(aggregate_count,"age_today")]
        }
    ]
 
 
class PlaintiffTimeChartView(GroupByChartView):
    datamodel = SQLAInterface(Plaintiff , db.session)
 
    chart_title = 'Grouped Birth Plaintiff'
    chart_type = 'AreaChart'
    label_columns = PlaintiffView.label_columns
    definitions = [
        {
            'group' : 'age_today',
            'formatter': pretty_month_year,
            "series" : [(aggregate_count,"age_today")]
        },
        {
            'group': 'age_today',
            'formatter': pretty_year,
            "series" : [(aggregate_count,"age_today")]
        }
    ]


 
class WitnessChartView(GroupByChartView):
    datamodel = SQLAInterface(Witness , db.session)
    chart_title = 'Grouped Witness by Birth'
    label_columns = WitnessView.label_columns
    chart_type = 'PieChart'
 
    definitions = [
        {
            'group' : 'age_today',
            "series" : [(aggregate_count,"age_today")]
        },
        {
            'group' : 'gender',
            "series" : [(aggregate_count,"age_today")]
        }
    ]
 
 
class WitnessTimeChartView(GroupByChartView):
    datamodel = SQLAInterface(Witness , db.session)
 
    chart_title = 'Grouped Birth Witness'
    chart_type = 'AreaChart'
    label_columns = WitnessView.label_columns
    definitions = [
        {
            'group' : 'age_today',
            'formatter': pretty_month_year,
            "series" : [(aggregate_count,"age_today")]
        },
        {
            'group': 'age_today',
            'formatter': pretty_year,
            "series" : [(aggregate_count,"age_today")]
        }
    ]


 
class SuretyChartView(GroupByChartView):
    datamodel = SQLAInterface(Surety , db.session)
    chart_title = 'Grouped Surety by Birth'
    label_columns = SuretyView.label_columns
    chart_type = 'PieChart'
 
    definitions = [
        {
            'group' : 'age_today',
            "series" : [(aggregate_count,"age_today")]
        },
        {
            'group' : 'gender',
            "series" : [(aggregate_count,"age_today")]
        }
    ]
 
 
class SuretyTimeChartView(GroupByChartView):
    datamodel = SQLAInterface(Surety , db.session)
 
    chart_title = 'Grouped Birth Surety'
    chart_type = 'AreaChart'
    label_columns = SuretyView.label_columns
    definitions = [
        {
            'group' : 'age_today',
            'formatter': pretty_month_year,
            "series" : [(aggregate_count,"age_today")]
        },
        {
            'group': 'age_today',
            'formatter': pretty_year,
            "series" : [(aggregate_count,"age_today")]
        }
    ]


 
class ProsecutorChartView(GroupByChartView):
    datamodel = SQLAInterface(Prosecutor , db.session)
    chart_title = 'Grouped Prosecutor by Birth'
    label_columns = ProsecutorView.label_columns
    chart_type = 'PieChart'
 
    definitions = [
        {
            'group' : 'age_today',
            "series" : [(aggregate_count,"age_today")]
        },
        {
            'group' : 'gender',
            "series" : [(aggregate_count,"age_today")]
        }
    ]
 
 
class ProsecutorTimeChartView(GroupByChartView):
    datamodel = SQLAInterface(Prosecutor , db.session)
 
    chart_title = 'Grouped Birth Prosecutor'
    chart_type = 'AreaChart'
    label_columns = ProsecutorView.label_columns
    definitions = [
        {
            'group' : 'age_today',
            'formatter': pretty_month_year,
            "series" : [(aggregate_count,"age_today")]
        },
        {
            'group': 'age_today',
            'formatter': pretty_year,
            "series" : [(aggregate_count,"age_today")]
        }
    ]


 
class PoliceofficerChartView(GroupByChartView):
    datamodel = SQLAInterface(Policeofficer , db.session)
    chart_title = 'Grouped Policeofficer by Birth'
    label_columns = PoliceofficerView.label_columns
    chart_type = 'PieChart'
 
    definitions = [
        {
            'group' : 'age_today',
            "series" : [(aggregate_count,"age_today")]
        },
        {
            'group' : 'gender',
            "series" : [(aggregate_count,"age_today")]
        }
    ]
 
 
class PoliceofficerTimeChartView(GroupByChartView):
    datamodel = SQLAInterface(Policeofficer , db.session)
 
    chart_title = 'Grouped Birth Policeofficer'
    chart_type = 'AreaChart'
    label_columns = PoliceofficerView.label_columns
    definitions = [
        {
            'group' : 'age_today',
            'formatter': pretty_month_year,
            "series" : [(aggregate_count,"age_today")]
        },
        {
            'group': 'age_today',
            'formatter': pretty_year,
            "series" : [(aggregate_count,"age_today")]
        }
    ]


 
class JudicialofficerChartView(GroupByChartView):
    datamodel = SQLAInterface(Judicialofficer , db.session)
    chart_title = 'Grouped Judicialofficer by Birth'
    label_columns = JudicialofficerView.label_columns
    chart_type = 'PieChart'
 
    definitions = [
        {
            'group' : 'age_today',
            "series" : [(aggregate_count,"age_today")]
        },
        {
            'group' : 'gender',
            "series" : [(aggregate_count,"age_today")]
        }
    ]
 
 
class JudicialofficerTimeChartView(GroupByChartView):
    datamodel = SQLAInterface(Judicialofficer , db.session)
 
    chart_title = 'Grouped Birth Judicialofficer'
    chart_type = 'AreaChart'
    label_columns = JudicialofficerView.label_columns
    definitions = [
        {
            'group' : 'age_today',
            'formatter': pretty_month_year,
            "series" : [(aggregate_count,"age_today")]
        },
        {
            'group': 'age_today',
            'formatter': pretty_year,
            "series" : [(aggregate_count,"age_today")]
        }
    ]


 
class DefendantChartView(GroupByChartView):
    datamodel = SQLAInterface(Defendant , db.session)
    chart_title = 'Grouped Defendant by Birth'
    label_columns = DefendantView.label_columns
    chart_type = 'PieChart'
 
    definitions = [
        {
            'group' : 'age_today',
            "series" : [(aggregate_count,"age_today")]
        },
        {
            'group' : 'gender',
            "series" : [(aggregate_count,"age_today")]
        }
    ]
 
 
class DefendantTimeChartView(GroupByChartView):
    datamodel = SQLAInterface(Defendant , db.session)
 
    chart_title = 'Grouped Birth Defendant'
    chart_type = 'AreaChart'
    label_columns = DefendantView.label_columns
    definitions = [
        {
            'group' : 'age_today',
            'formatter': pretty_month_year,
            "series" : [(aggregate_count,"age_today")]
        },
        {
            'group': 'age_today',
            'formatter': pretty_year,
            "series" : [(aggregate_count,"age_today")]
        }
    ]


# How to create a MasterDetailView
 
#class DetailView(ModelView):
#    datamodel = SQLAInterface(DetailTable, db.session)
 
#class MasterView(MasterDetailView):
#    datamodel = SQLAInterface(MasterTable, db.session)
#    related_views = [DetailView]
 
 
# How to create a MultipleView
#class MultipleViewsExp(MultipleView):
#    views = [GroupModelView, ContactModelView]
 
#View Registration
db.create_all()
fill_gender()
 
appbuilder.add_view(LawyerView(), "Lawyers", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(PolicemanView(), "Policemans", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(BailView(), "Bails", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(CaseView(), "Cases", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(CasecategoryView(), "Casecategorys", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(CauseofactionView(), "Causeofactions", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(CommitaltypeView(), "Commitaltypes", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(ConstituencyView(), "Constituencys", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(CountyView(), "Countys", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(CourtView(), "Courts", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(CourtlevelView(), "Courtlevels", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(CourtstationView(), "Courtstations", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(DefendantView(), "Defendants", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(DoctemplateView(), "Doctemplates", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(DocumentView(), "Documents", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(FilingView(), "Filings", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(FilingtypeView(), "Filingtypes", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(GenderView(), "Genders", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(HearingView(), "Hearings", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(HearingtypeView(), "Hearingtypes", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(InvestigationView(), "Investigations", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(JoRankView(), "JoRanks", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(JudicialofficerView(), "Judicialofficers", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(LawfirmView(), "Lawfirms", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(NatureofsuitView(), "Natureofsuits", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(PaymentView(), "Payments", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(PaymentmethodView(), "Paymentmethods", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(PlaintiffView(), "Plaintiffs", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(PolicerankView(), "Policeranks", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(PoliceroleView(), "Policeroles", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(PolicestationView(), "Policestations", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(PolicestationtypeView(), "Policestationtypes", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(PrisonView(), "Prisons", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(PrisoncommitalView(), "Prisoncommitals", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(ProsecutorView(), "Prosecutors", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(ProsecutorteamView(), "Prosecutorteams", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(SubcountyView(), "Subcountys", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(SuretyView(), "Suretys", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(TownView(), "Towns", icon="fa-folder-open-o", category="Setup") 

appbuilder.add_view(WitnesView(), "Witness", icon="fa-folder-open-o", category="Setup") 

 
 
appbuilder.add_view(AttorneyChartView(), 'Attorney Age Chart', icon='fa-dashboard', category='Reports')
appbuilder.add_view(AttorneyTimeChartView(), 'Attorney Time Chart', icon='fa-dashboard', category='Reports')
 
appbuilder.add_view(PlaintiffChartView(), 'Plaintiff Age Chart', icon='fa-dashboard', category='Reports')
appbuilder.add_view(PlaintiffTimeChartView(), 'Plaintiff Time Chart', icon='fa-dashboard', category='Reports')
 
appbuilder.add_view(WitnessChartView(), 'Witness Age Chart', icon='fa-dashboard', category='Reports')
appbuilder.add_view(WitnessTimeChartView(), 'Witness Time Chart', icon='fa-dashboard', category='Reports')
 
appbuilder.add_view(SuretyChartView(), 'Surety Age Chart', icon='fa-dashboard', category='Reports')
appbuilder.add_view(SuretyTimeChartView(), 'Surety Time Chart', icon='fa-dashboard', category='Reports')
 
appbuilder.add_view(ProsecutorChartView(), 'Prosecutor Age Chart', icon='fa-dashboard', category='Reports')
appbuilder.add_view(ProsecutorTimeChartView(), 'Prosecutor Time Chart', icon='fa-dashboard', category='Reports')
 
appbuilder.add_view(PoliceofficerChartView(), 'Policeofficer Age Chart', icon='fa-dashboard', category='Reports')
appbuilder.add_view(PoliceofficerTimeChartView(), 'Policeofficer Time Chart', icon='fa-dashboard', category='Reports')
 
appbuilder.add_view(JudicialofficerChartView(), 'Judicialofficer Age Chart', icon='fa-dashboard', category='Reports')
appbuilder.add_view(JudicialofficerTimeChartView(), 'Judicialofficer Time Chart', icon='fa-dashboard', category='Reports')
 
appbuilder.add_view(DefendantChartView(), 'Defendant Age Chart', icon='fa-dashboard', category='Reports')
appbuilder.add_view(DefendantTimeChartView(), 'Defendant Time Chart', icon='fa-dashboard', category='Reports')
 
#appbuilder.add_separator("Setup")
#appbuilder.add_separator("My Views")
#appbuilder.add_link(name, href, icon='', label='', category='', category_icon='', category_label='', baseview=None)
