Exemple #1
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)
Exemple #2
0
)

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()


urlpatterns = patterns('',
    # Examples:
    url(r'^$', IndexView.as_view(), name='index'),
    url(r'^client-side$', ClientSideView.as_view(), name='client-side'),
    url(r'^server-side$', ServerSideView.as_view(), name='server-side'),
    url(r'^server-side-search$', ServerSideSearchView.as_view(), name='server-side-search'),
    url(r'^server-side-objects$', ServerSideObjectsView.as_view(), name='server-side-objects'),
    url(r'^server-side-custom$', ServerSideCustomView.as_view(), name='server-side-custom'),
    url(r'^defered-loading$', DeferredLoadingView.as_view(), name='deferred-loading'),
    url(r'^localization$', LocalizationView.as_view(), name='localization'),
    url(r'^browsers/', include(patterns('',
        url(r'^default$', FormattedBrowserDatatablesView.as_view(), name='DT-browsers-default'),
        url(r'^objects$', ObjectBrowserDatatablesView.as_view(), name='DT-browsers-objects'),
        url(r'^custom$', CustomBrowserDatatablesView.as_view(), name='DT-browsers-custom'),
    ))),
    url(r'^js/', include('djangojs.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
)
Exemple #3
0

urlpatterns = patterns(
    "",
    # Examples:
    url(r"^$", IndexView.as_view(), name="index"),
    url(r"^client-side$", ClientSideView.as_view(), name="client-side"),
    url(r"^server-side$", ServerSideView.as_view(), name="server-side"),
    url(r"^server-side-search$", ServerSideSearchView.as_view(), name="server-side-search"),
    url(r"^server-side-objects$", ServerSideObjectsView.as_view(), name="server-side-objects"),
    url(r"^server-side-custom$", ServerSideCustomView.as_view(), name="server-side-custom"),
    url(r"^defered-loading$", DeferredLoadingView.as_view(), name="deferred-loading"),
    url(r"^localization$", LocalizationView.as_view(), name="localization"),
    url(
        r"^browsers/",
        include(
            patterns(
                "",
                url(r"^default$", FormattedBrowserDatatablesView.as_view(), name="DT-browsers-default"),
                url(r"^objects$", ObjectBrowserDatatablesView.as_view(), name="DT-browsers-objects"),
                url(r"^custom$", CustomBrowserDatatablesView.as_view(), name="DT-browsers-custom"),
            )
        ),
    ),
    url(r"^js/", include("djangojs.urls")),
    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
    # Uncomment the next line to enable the admin:
    url(r"^admin/", include(admin.site.urls)),
)
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'),
)
Exemple #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())
Exemple #6
0
    url(r'^server-side-custom$',
        ServerSideCustomView.as_view(),
        name='server-side-custom'),
    url(r'^defered-loading$',
        DeferredLoadingView.as_view(),
        name='deferred-loading'),
    url(r'^localization$', LocalizationView.as_view(), name='localization'),
    url(
        r'^browsers/',
        include(
            patterns(
                '',
                url(r'^default$',
                    FormattedBrowserDatatablesView.as_view(),
                    name='DT-browsers-default'),
                url(r'^objects$',
                    ObjectBrowserDatatablesView.as_view(),
                    name='DT-browsers-objects'),
                url(r'^custom$',
                    CustomBrowserDatatablesView.as_view(),
                    name='DT-browsers-custom'),
            ))),
    url(r'^js/', include('djangojs.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
)
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'),
)