.. _include:
`include`
---------
The `include` configuration is used to include or exclude parts programmatically. Let's start with a simple example of a table:
.. code-block:: python
table = Table(
auto__model=Album,
)
.. raw:: html
▼ Hide result
Toggle structure
We could make the `name` column only visible for staff users:
.. code-block:: python
table = Table(
auto__model=Album,
columns__name__include=lambda user, **_: user.is_staff,
)
.. raw:: html
▼ Hide result
Toggle structure