mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-10-16 02:24:57 +02:00
Export club members
This commit is contained in:
@@ -92,6 +92,20 @@ class MembershipTable(tables.Table):
|
||||
}
|
||||
)
|
||||
|
||||
user_email = tables.Column(
|
||||
verbose_name="Email",
|
||||
accessor="user.email",
|
||||
orderable=False,
|
||||
visible=False,
|
||||
)
|
||||
|
||||
user_full_name = tables.Column(
|
||||
verbose_name=_("Full name"),
|
||||
accessor="user.get_full_name",
|
||||
orderable=False,
|
||||
visible=False,
|
||||
)
|
||||
|
||||
def render_user(self, value):
|
||||
# If the user has the right, link the displayed user with the page of its detail.
|
||||
s = value.username
|
||||
@@ -149,6 +163,16 @@ class MembershipTable(tables.Table):
|
||||
+ "'>" + s + "</a>")
|
||||
return s
|
||||
|
||||
def value_user(self, record):
|
||||
return record.user.username if record.user else ""
|
||||
|
||||
def value_club(self, record):
|
||||
return record.club.name if record.club else ""
|
||||
|
||||
def value_roles(self, record):
|
||||
roles = record.roles.all()
|
||||
return ", ".join(str(role) for role in roles)
|
||||
|
||||
class Meta:
|
||||
attrs = {
|
||||
'class': 'table table-condensed table-striped',
|
||||
|
Reference in New Issue
Block a user