class DT(Datatable):
            my_column = TextColumn('Data',
                                   sources=['name', 'get_absolute_url'])

            class Meta:
                model = ExampleModel
                columns = ['my_column']
        class DT(Datatable):
            related = TextColumn('Related', ['related__name'])

            class Meta:
                model = ExampleModel
                columns = ['related']
                search_fields = ['name']
        class DT(Datatable):
            name = TextColumn('Name', sources=['name'])

            class Meta:
                model = ExampleModel
                columns = ['name']
                ordering = ['pk']
        class DT(Datatable):
            my_column = TextColumn('Data',
                                   sources=['date_created', 'name', 'pk'])

            class Meta:
                model = ExampleModel
                columns = ['my_column']
Example #5
0
        class DT(Datatable):
            related = TextColumn("Related", ["related__name"])

            class Meta:
                model = ExampleModel
                columns = ["related"]
                search_fields = ["name"]
Example #6
0
        class DT(Datatable):
            name = TextColumn("Name", sources=["name"])

            class Meta:
                model = ExampleModel
                columns = ["name"]
                ordering = ["pk"]
        class DT(Datatable):
            my_column = TextColumn('Data',
                                   sources=['get_absolute_url', 'name'],
                                   processor='get_data')

            class Meta:
                model = ExampleModel
                columns = ['my_column']

            def get_data(self, obj, **kwargs):
                # Return data that would make the sort order wrong if it were consulted for sorting
                return obj.pk  # tracks with get_absolute_url
Example #8
0
        class DT(Datatable):
            my_column = TextColumn(
                "Data", sources=["get_absolute_url", "name"], processor="get_data"
            )

            class Meta:
                model = ExampleModel
                columns = ["my_column"]

            def get_data(self, obj, **kwargs):
                # Return data that would make the sort order wrong if it were consulted for sorting
                return obj.pk  # tracks with get_absolute_url
        class DT(Datatable):
            fake = TextColumn('Fake', sources=['get_absolute_url'])

            class Meta:
                model = ExampleModel
                columns = ['name', 'fake']
        class DT(Datatable):
            pk = TextColumn('Data', sources=['get_negative_pk'])

            class Meta:
                model = ExampleModel
                columns = ['pk']
Example #11
0
        class DT(Datatable):
            fake = TextColumn("Fake", sources=["get_absolute_url"])

            class Meta:
                model = ExampleModel
                columns = ["name", "fake"]
Example #12
0
        class DT(Datatable):
            pk = TextColumn("Data", sources=["get_negative_pk"])

            class Meta:
                model = ExampleModel
                columns = ["pk"]
Example #13
0
        class DT(Datatable):
            my_column = TextColumn("Data", sources=["name", "get_absolute_url"])

            class Meta:
                model = ExampleModel
                columns = ["my_column"]
Example #14
0
        class DT(Datatable):
            my_column = TextColumn("Data", sources=["date_created", "name", "pk"])

            class Meta:
                model = ExampleModel
                columns = ["my_column"]