# Create your views here.
from django.views.generic import View
from django.http import Http404
from listable.views  import BaseListableView, Column

from . import models

class StaffList(BaseListableView):

    model = models.Staff

    columns = (
        Column(field="id", ordering=True, filtering=False),
        Column(field="name", ordering="last_name", filtering=True),
        Column(field="department", ordering="department__name", filtering=True),
        Column(field="position", ordering="position__name", filtering=True),
        Column(field="business", ordering="department__business__name", filtering=True),
    )

    def name(self, staff):
        return staff.name()

    def department(self, staff):
        return staff.department.name

    def business(self, staff):
        return staff.department.business.name


@@ -262,19 +262,44 @@
 umn(
-field=%22id%22,
+%0A            field=%22id%22,%0A           
  ord
@@ -309,16 +309,28 @@
 ng=True,
+%0A           
  filteri
@@ -337,16 +337,25 @@
 ng=False
+%0A        
 ),%0A     
@@ -360,24 +360,37 @@
      Column(
+%0A            
 field=%22name%22
@@ -390,16 +390,28 @@
 =%22name%22,
+%0A           
  orderin
@@ -420,24 +420,36 @@
 %22last_name%22,
+%0A           
  filtering=T
@@ -443,32 +443,41 @@
   filtering=True
+%0A        
 ),%0A        Colum
@@ -474,24 +474,37 @@
      Column(
+%0A            
 field=%22depar
@@ -510,16 +510,28 @@
 rtment%22,
+%0A           
  orderin
@@ -543,32 +543,44 @@
 partment__name%22,
+%0A           
  filtering=True)
@@ -570,32 +570,41 @@
   filtering=True
+%0A        
 ),%0A        Colum
@@ -601,24 +601,73 @@
      Column(
+%0A            header=%22Position Name%22,%0A            
 field=%22posit
@@ -671,16 +671,28 @@
 sition%22,
+%0A           
  orderin
@@ -702,32 +702,44 @@
 position__name%22,
+%0A           
  filtering=True)
@@ -733,24 +733,33 @@
 ltering=True
+%0A        
 ),%0A        C
@@ -764,16 +764,65 @@
  Column(
+%0A            header=%22Business Name%22,%0A            
 field=%22b
@@ -830,16 +830,28 @@
 siness%22,
+%0A           
  orderin
@@ -881,16 +881,28 @@
 __name%22,
+%0A           
  filteri
@@ -908,16 +908,25 @@
 ing=True
+%0A        
 ),%0A    )

add header value to a couple columns