Commit 89cedd18 authored by erdnaxe's avatar erdnaxe 🎇

Admin for club

parent 5172f748
Pipeline #1346 failed with stage
in 2 minutes and 17 seconds
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment