conjunto.components
¶
conjunto.components.DataGrid
¶
Bases: Component
The DataGrid class is a component that generates a data grid for displaying data
in a tabular format.
It automatically determines all regular model fields and shows their translated title. It also detects properties/getters instead of fields, the component tries to find out a proper name as title here by creating a capitalized version of the property name and translating it into the locale language. However, you have to provide a proper translation string for your property name in your .po file manually.
Note To keep Django's
makemessagesfrom commenting out these "unused" translations, just add an unused_("...")string anywhere into your method. E.g. when your property is named "display_name()", just add a_("Display name")anywhere into this method block. This keeps Django from garbage collecting this translation.
| Attributes: |
|
|---|
Example usage:
{% #datagrid object=request.user fields="first_name,last_name,email" %}
get_context_data(**kwargs)
¶
renders fields of given object in a datagrid-usable form.
conjunto.components.List
¶
Bases: Component
A flexible component to display a Tabler.io list.
| Attributes: |
|
|---|
conjunto.components.Updateable
¶
Bases: Component
HTML element that updates itself using HTMX when a certain Javascript event is triggerd anywhere in the body.
| Attributes: |
|
|---|
Example
{% updateable id="my-card" trigger="person:changed" url=request.path %}
{% url 'person:update' as person_update_url %}
{% updateable elt="ul" id="people-list" trigger="person:changed" url=person_update_url %}