Beispiel #1
0
class ArrayMixin(object):
    urls = patterns(
        '',
        url(r'^$', BrowserDatatablesView.as_view(), name='browsers'),
        url(r'^formatted/$',
            FormattedBrowserDatatablesView.as_view(),
            name='formatted-browsers'),
        url(r'^custom/$',
            CustomBrowserDatatablesView.as_view(),
            name='custom-browsers'),
        url(r'^special/$', SpecialCaseDatatablesView.as_view(),
            name='special'),
        url(r'^extra/$', ExtraBrowserDatatablesViewAll.as_view(),
            name='extra'),
        url(r'^extra_row/$',
            ExtraBrowserDatatablesViewRow.as_view(),
            name='extra_row'),
        url(r'^format_row/$',
            UserFormatRowBrowserDatatablesView.as_view(),
            name='format_row'),
        url(r'^filter_function/$',
            FilterFunctionBrowserDatatablesView.as_view(),
            name='filter_function'),
        url(r'^filter_list/$',
            FilterListBrowserDatatablesView.as_view(),
            name='filter_list'),
        url(r'^filter_dict/$',
            FilterDictBrowserDatatablesView.as_view(),
            name='filter_dict'),
        url(r'^filter_set/$',
            FilterSetBrowserDatatablesView.as_view(),
            name='filter_set'),
    )

    def value(self, row, field_id):
        return row[field_id]

    def assertInstance(self, row):
        self.assertTrue(isinstance(row, list))
        self.assertEqual(len(row), 6)

    def assertRowUpper(self, row):
        for value in row:
            if not value.isdigit():
                self.assertTrue(value.isupper())
Beispiel #2
0
class ArrayMixin(object):
    urls = patterns(
        '',
        url(r'^$', BrowserDatatablesView.as_view(), name='browsers'),
        url(r'^formatted/$',
            FormattedBrowserDatatablesView.as_view(),
            name='formatted-browsers'),
        url(r'^custom/$',
            CustomBrowserDatatablesView.as_view(),
            name='custom-browsers'),
        url(r'^special/$', SpecialCaseDatatablesView.as_view(),
            name='special'),
    )

    def value(self, row, field_id):
        return row[field_id]

    def assertInstance(self, row):
        self.assertTrue(isinstance(row, list))
        self.assertEqual(len(row), 6)
Beispiel #3
0
class ObjectMixin(object):
    urls = patterns(
        '',
        url(r'^$', ObjectBrowserDatatablesView.as_view(), name='browsers'),
        url(r'^formatted/$',
            FormattedObjectBrowserDatatablesView.as_view(),
            name='formatted-browsers'),
        url(r'^custom/$',
            CustomObjectBrowserDatatablesView.as_view(),
            name='custom-browsers'),
        url(r'^special/$', SpecialCaseDatatablesView.as_view(),
            name='special'),
    )

    id_to_name = {
        0: 'engine',
        1: 'name',
        2: 'platform',
        3: 'version',
        4: 'engine_version',
        5: 'css_grade',
    }

    def build_query(self, **kwargs):
        query = super(ObjectMixin, self).build_query(**kwargs)
        query.update(
            dict((('mDataProp_%s' % k, v)
                  for k, v in iteritems(self.id_to_name))))
        return query

    def value(self, row, field_id):
        return row[self.id_to_name[field_id]]

    def assertInstance(self, row):
        self.assertTrue(isinstance(row, dict))
        for key in list(self.id_to_name.values()):
            self.assertTrue(key in row)
from django.conf.urls import patterns, url

from eztables.demo.views import (
    ObjectBrowserDatatablesView,
    FormattedObjectBrowserDatatablesView,
    CustomObjectBrowserDatatablesView,
    SpecialCaseDatatablesView,
)

urlpatterns = patterns('',
    url(r'^$', ObjectBrowserDatatablesView.as_view(), name='browsers'),
    url(r'^formatted/$', FormattedObjectBrowserDatatablesView.as_view(), name='formatted-browsers'),
    url(r'^custom/$', CustomObjectBrowserDatatablesView.as_view(), name='custom-browsers'),
    url(r'^special/$', SpecialCaseDatatablesView.as_view(), name='special'),
)
Beispiel #5
0
class ObjectMixin(object):
    urls = patterns(
        '',
        url(r'^$', ObjectBrowserDatatablesView.as_view(), name='browsers'),
        url(r'^formatted/$',
            FormattedObjectBrowserDatatablesView.as_view(),
            name='formatted-browsers'),
        url(r'^custom/$',
            CustomObjectBrowserDatatablesView.as_view(),
            name='custom-browsers'),
        url(r'^special/$', SpecialCaseDatatablesView.as_view(),
            name='special'),
        url(r'^extra/$',
            ExtraObjectBrowserDatatablesViewAll.as_view(),
            name='extra'),
        url(r'^extra_row/$',
            ExtraObjectBrowserDatatablesViewRow.as_view(),
            name='extra_row'),
        url(r'^format_row/$',
            UserFormatRowObjectBrowserDatatablesView.as_view(),
            name='format_row'),
        url(r'^filter_function/$',
            FilterFunctionObjectBrowserDatatablesView.as_view(),
            name='filter_function'),
        url(r'^filter_list/$',
            FilterListObjectBrowserDatatablesView.as_view(),
            name='filter_list'),
        url(r'^filter_dict/$',
            FilterDictObjectBrowserDatatablesView.as_view(),
            name='filter_dict'),
        url(r'^filter_set/$',
            FilterSetObjectBrowserDatatablesView.as_view(),
            name='filter_set'),
    )

    id_to_name = {
        0: 'engine',
        1: 'name',
        2: 'platform',
        3: 'version',
        4: 'engine_version',
        5: 'css_grade',
    }

    def build_query(self, **kwargs):
        query = super(ObjectMixin, self).build_query(**kwargs)
        query.update(
            dict((('mDataProp_%s' % k, v)
                  for k, v in iteritems(self.id_to_name))))
        return query

    def value(self, row, field_id):
        return row[self.id_to_name[field_id]]

    def assertInstance(self, row):
        self.assertTrue(isinstance(row, dict))
        for key in self.id_to_name.values():
            self.assertTrue(key in row)

    def assertRowUpper(self, row):
        for value in row.itervalues():
            if not value.isdigit():
                self.assertTrue(value.isupper())
from django.conf.urls import patterns, url

from eztables.demo.views import (
    BrowserDatatablesView,
    FormattedBrowserDatatablesView,
    CustomBrowserDatatablesView,
    SpecialCaseDatatablesView,
)

urlpatterns = patterns(
    '',
    url(r'^$', BrowserDatatablesView.as_view(), name='browsers'),
    url(r'^formatted/$',
        FormattedBrowserDatatablesView.as_view(),
        name='formatted-browsers'),
    url(r'^custom/$',
        CustomBrowserDatatablesView.as_view(),
        name='custom-browsers'),
    url(r'^special/$', SpecialCaseDatatablesView.as_view(), name='special'),
)