mirror of
https://gitlab.crans.org/bde/nk20
synced 2024-12-23 07:52:23 +00:00
Admin for club
This commit is contained in:
parent
5172f74845
commit
89cedd18f1
@ -7,7 +7,7 @@ from django.contrib.auth.admin import UserAdmin
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
from .forms import CustomUserChangeForm
|
||||
from .models import Profile
|
||||
from .models import Profile, Club
|
||||
|
||||
|
||||
class ProfileInline(admin.StackedInline):
|
||||
@ -35,3 +35,4 @@ class CustomUserAdmin(UserAdmin):
|
||||
|
||||
admin.site.unregister(User)
|
||||
admin.site.register(User, CustomUserAdmin)
|
||||
admin.site.register(Club)
|
||||
|
@ -56,7 +56,7 @@ msgstr "courriel"
|
||||
|
||||
#: models.py:70
|
||||
msgid "membership fee"
|
||||
msgstr "cotisation"
|
||||
msgstr "cotisation pour adhérer"
|
||||
|
||||
#: models.py:74
|
||||
msgid "membership duration"
|
||||
|
@ -59,8 +59,9 @@ class Club(models.Model):
|
||||
A student club
|
||||
"""
|
||||
name = models.CharField(
|
||||
verbose_name=_('paid'),
|
||||
verbose_name=_('name'),
|
||||
max_length=255,
|
||||
unique=True,
|
||||
)
|
||||
email = models.EmailField(
|
||||
verbose_name=_('email'),
|
||||
@ -94,6 +95,9 @@ class Club(models.Model):
|
||||
verbose_name = _("club")
|
||||
verbose_name_plural = _("clubs")
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
||||
class Role(models.Model):
|
||||
"""
|
||||
@ -102,6 +106,7 @@ class Role(models.Model):
|
||||
name = models.CharField(
|
||||
verbose_name=_('name'),
|
||||
max_length=255,
|
||||
unique=True,
|
||||
)
|
||||
|
||||
class Meta:
|
||||
|
@ -17,6 +17,8 @@ class NoteClubAdmin(admin.ModelAdmin):
|
||||
"""
|
||||
inlines = (AliasInlines,)
|
||||
list_display = ('club', 'balance', 'is_active')
|
||||
list_filter = ('is_active',)
|
||||
search_fields = ['club__name']
|
||||
|
||||
|
||||
class NoteSpecialAdmin(admin.ModelAdmin):
|
||||
@ -32,9 +34,12 @@ class NoteUserAdmin(admin.ModelAdmin):
|
||||
"""
|
||||
inlines = (AliasInlines,)
|
||||
list_display = ('user', 'balance', 'is_active')
|
||||
list_filter = ('is_active',)
|
||||
search_fields = ['user__username']
|
||||
|
||||
# Organize note by registration date
|
||||
date_hierarchy = 'user__date_joined'
|
||||
ordering = ['-user__date_joined']
|
||||
|
||||
|
||||
# Register your models here.
|
||||
|
Loading…
Reference in New Issue
Block a user