=== removed file 'lava_scheduler_app/tables.py'
--- lava_scheduler_app/tables.py	2012-03-07 05:10:27 +0000
+++ lava_scheduler_app/tables.py	1970-01-01 00:00:00 +0000
@@ -1,116 +0,0 @@
-import simplejson
-
-from django.template import compile_string, RequestContext
-
-from django_tables2.columns import BoundColumn
-from django_tables2.rows import BoundRow
-from django_tables2.tables import Table, TableData
-from django_tables2.utils import AttributeDict
-
-from lava.utils.data_tables.views import DataTableView
-from lava.utils.data_tables.backends import QuerySetBackend
-
-
-simple_nodelist = compile_string('{{ a }}', None)
-
-
-class _ColWrapper(object):
-
-    def __init__(self, name, table):
-        self.name = name
-        self.sort_expr = table.columns[name].accessor.replace('.', '__')
-        self.table = table
-
-    def callback(self, record):
-        context = self.table.context
-        context.update({"a": BoundRow(self.table, record)[self.name]})
-        try:
-            return simple_nodelist.render(context)
-        finally:
-            context.pop()
-
-
-class _AjaxTableData(TableData):
-    def order_by(self, order_by):
-        if order_by:
-            raise AssertionError(
-                "AjaxTables do not support ordering by Table options")
-        return
-
-
-class AjaxTable(Table):
-    TableDataClass = _AjaxTableData
-
-    def __init__(self, id, source, params=(), _for_rendering=True, **kw):
-        if 'template' not in kw:
-            kw['template'] = 'lava_scheduler_app/ajax_table.html'
-        self.params = params
-        self.total_length = None
-        if _for_rendering:
-            qs = self.get_queryset()
-            self.total_length = qs.count()
-
-            ordering = self.datatable_opts.get('aaSorting', [[0, 'asc']])
-            # What follows is duplicated from backends.py which isn't ideal.
-            order_by = []
-            for column_index, order in ordering:
-                name, col = self.base_columns.items()[column_index]
-                sort_expr = BoundColumn(self, col, name).accessor.replace('.', '__')
-                order_by.append(
-                    "{asc_desc}{column}".format(
-                        asc_desc="-" if order == 'desc' else '',
-                        column=sort_expr))
-            qs = qs.order_by(*order_by)
-
-            display_length = self.datatable_opts.get('iDisplayLength', 10)
-            qs = qs[:display_length]
-        else:
-            qs = []
-        super(AjaxTable, self).__init__(data=qs, **kw)
-        self.source = source
-        self.attrs = AttributeDict({
-            'id': id,
-            'class': 'display',
-            })
-
-    @classmethod
-    def json(cls, request, params=()):
-        table = cls(None, None, params, _for_rendering=False)
-        table.context = RequestContext(request)
-        our_cols = [_ColWrapper(name, table) for name in table.columns.names()]
-        return DataTableView.as_view(
-            backend=QuerySetBackend(
-                queryset=table.get_queryset(),
-                columns=our_cols,
-                searching_columns=cls.searchable_columns)
-            )(request)
-
-    def datatable_options(self):
-        if self.datatable_opts:
-            opts = self.datatable_opts.copy()
-        else:
-            opts = {}
-        opts.update({
-            'bJQueryUI': True,
-            'bServerSide': True,
-            'bProcessing': True,
-            'sAjaxSource': self.source,
-            'bFilter': bool(self.searchable_columns)
-            })
-        if self.total_length is not None:
-            opts['iDeferLoading'] = self.total_length
-        aoColumnDefs = opts['aoColumnDefs'] = []
-        for col in self.columns:
-            aoColumnDefs.append({
-                'bSortable': bool(col.sortable),
-                'mDataProp': col.name,
-                'aTargets': [col.name],
-                })
-        return simplejson.dumps(opts)
-
-    datatable_opts = {}
-    searchable_columns = []
-
-    def get_queryset(self):
-        raise NotImplementedError
-

=== modified file 'lava_scheduler_app/views.py'
--- lava_scheduler_app/views.py	2012-03-13 03:18:14 +0000
+++ lava_scheduler_app/views.py	2012-03-13 03:29:49 +0000
@@ -24,6 +24,8 @@
 
 from django_tables2 import Attrs, Column
 
+from lava.utils.data_tables.tables import DataTablesTable
+
 from lava_server.views import index as lava_index
 from lava_server.bread_crumbs import (
     BreadCrumb,
@@ -40,9 +42,6 @@
     DeviceStateTransition,
     TestJob,
     )
-from lava_scheduler_app.tables import (
-    AjaxTable,
-    )
 
 
 
@@ -98,7 +97,7 @@
             }).all()
 
 
-class JobTable(AjaxTable):
+class JobTable(DataTablesTable):
 
     def render_device(self, record):
         if record.actual_device:
@@ -142,7 +141,7 @@
     return IndexJobTable.json(request)
 
 
-class DeviceTable(AjaxTable):
+class DeviceTable(DataTablesTable):
 
     def get_queryset(self):
         return Device.objects.select_related("device_type")
@@ -177,7 +176,7 @@
         TestJob.objects.accessible_by_principal(user), pk=pk)
 
 
-class DeviceHealthTable(AjaxTable):
+class DeviceHealthTable(DataTablesTable):
 
     def get_queryset(self):
         return Device.objects.select_related(
@@ -225,8 +224,7 @@
 
 class HealthJobTable(JobTable):
 
-    def get_queryset(self):
-        device, = self.params
+    def get_queryset(self, device):
         return TestJob.objects.select_related(
             "submitter",
             ).filter(
@@ -467,8 +465,7 @@
 
 class RecentJobsTable(JobTable):
 
-    def get_queryset(self):
-        device, = self.params
+    def get_queryset(self, device):
         return device.recent_jobs()
 
     class Meta:
@@ -480,10 +477,9 @@
     return RecentJobsTable.json(request, params=(device,))
 
 
-class DeviceTransitionTable(AjaxTable):
+class DeviceTransitionTable(DataTablesTable):
 
-    def get_queryset(self):
-        device, = self.params
+    def get_queryset(self, device):
         qs = device.transitions.select_related('created_by')
         qs = qs.extra(select={'prev': """
         select t.created_on
@@ -503,7 +499,8 @@
 
     def render_transition(self, record):
         t = record
-        return '%s &rarr; %s' % (t.get_old_state_display(), t.get_new_state_display(),)
+        return mark_safe(
+            '%s &rarr; %s' % (t.get_old_state_display(), t.get_new_state_display(),))
 
     def render_message(self, value):
         if value is None:

=== modified file 'setup.py'
--- setup.py	2012-03-07 03:49:20 +0000
+++ setup.py	2012-03-13 01:19:49 +0000
@@ -35,7 +35,7 @@
     install_requires=[
         "django-restricted-resource",
         "django-tables2 >= 0.9.4",
-        "lava-server >= 0.10",
+        "lava-server >= 0.11.dev355",
         "simplejson",
         "south >= 0.7.3",
         "twisted",

