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']
示例#5
0
        class DT(Datatable):
            related = TextColumn("Related", ["related__name"])

            class Meta:
                model = ExampleModel
                columns = ["related"]
                search_fields = ["name"]
示例#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
示例#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']
示例#11
0
        class DT(Datatable):
            fake = TextColumn("Fake", sources=["get_absolute_url"])

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

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

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

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