2023-11-22 18:46:36 +00:00
|
|
|
import django_tables2 as tables
|
2023-12-14 11:14:14 +00:00
|
|
|
from django.utils.translation import gettext_lazy as _
|
2023-11-22 18:46:36 +00:00
|
|
|
from idhub.models import Rol, Event
|
|
|
|
from idhub_auth.models import User
|
|
|
|
|
|
|
|
|
|
|
|
class UserTable(tables.Table):
|
|
|
|
class Meta:
|
|
|
|
model = User
|
|
|
|
template_name = "idhub/custom_table.html"
|
|
|
|
fields = ("first_name", "last_name", "email", "is_active", "is_admin")
|
|
|
|
|
|
|
|
|
|
|
|
class RolesTable(tables.Table):
|
|
|
|
class Meta:
|
|
|
|
model = Rol
|
|
|
|
template_name = "idhub/custom_table.html"
|
|
|
|
fields = ("name", "description")
|
|
|
|
|
|
|
|
|
|
|
|
class DashboardTable(tables.Table):
|
2023-12-14 11:14:14 +00:00
|
|
|
type = tables.Column(verbose_name=_("Event"))
|
|
|
|
message = tables.Column(verbose_name=_("Description"))
|
|
|
|
created = tables.Column(verbose_name=_("Date"))
|
2023-11-24 12:04:17 +00:00
|
|
|
|
2023-11-22 18:46:36 +00:00
|
|
|
class Meta:
|
|
|
|
model = Event
|
|
|
|
template_name = "idhub/custom_table.html"
|
|
|
|
fields = ("type", "message", "created")
|