physics_workload.app.tables.unit¶
Classes¶
Describe a table. Example: |
Module Contents¶
- class physics_workload.app.tables.unit.UnitTable(**kwargs)¶
Bases:
iommi.Table
Describe a table. Example:
class AlbumTable(Table): name = Column() artist = Column() class Meta: sortable = False # @test artist = Artist.objects.create(name='Black Sabbath') Album.objects.create(name='Heaven & Hell', artist=artist, year=1980), Album.objects.create(name='Mob Rules', artist=artist, year=1981), show_output(AlbumTable(rows=Album.objects.all())) # @end
- Parameters:
rows – a list or QuerySet of objects
columns – (use this only when not using the declarative style) a list of Column objects
attrs – dict of strings to string/callable of HTML attributes to apply to the table
row__attrs – dict of strings to string/callable of HTML attributes to apply to the row. Callables are passed the row as argument.
row__template – name of template (or Template object) to use for rendering the row
bulk_filter – filters to apply to the QuerySet before performing the bulk operation
bulk_exclude – exclude filters to apply to the QuerySet before performing the bulk operation
sortable – set this to False to turn off sorting for all columns
- static filter_status_into_query(value_string_or_f) django.db.models.Q ¶
- static annotate_query_set(query_set: django.db.models.QuerySet[app.models.Unit]) django.db.models.QuerySet[app.models.Unit] ¶