diff --git a/member/admin.py b/member/admin.py index a6918d19..4ac79ec0 100644 --- a/member/admin.py +++ b/member/admin.py @@ -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) diff --git a/member/locale/fr/LC_MESSAGES/django.po b/member/locale/fr/LC_MESSAGES/django.po index e3795f30..75e11d6d 100644 --- a/member/locale/fr/LC_MESSAGES/django.po +++ b/member/locale/fr/LC_MESSAGES/django.po @@ -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" diff --git a/member/models.py b/member/models.py index db52cdd9..eca2351c 100644 --- a/member/models.py +++ b/member/models.py @@ -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: diff --git a/note/admin.py b/note/admin.py index 8b786666..9ec51a77 100644 --- a/note/admin.py +++ b/note/admin.py @@ -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.