2019-07-08 11:59:31 +00:00
|
|
|
# -*- mode: python; coding: utf-8 -*-
|
|
|
|
# Copyright (C) 2018-2019 by BDE ENS Paris-Saclay
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
2019-07-16 13:42:31 +00:00
|
|
|
|
|
|
|
from django.contrib import admin
|
|
|
|
|
|
|
|
from .models import Activity, ActivityType, Guest
|
|
|
|
|
|
|
|
|
|
|
|
class ActivityAdmin(admin.ModelAdmin):
|
|
|
|
"""
|
|
|
|
Admin customisation for Activity
|
|
|
|
"""
|
|
|
|
list_display = ('name', 'activity_type', 'organizer')
|
2020-02-18 11:31:15 +00:00
|
|
|
list_filter = ('activity_type', )
|
2019-07-16 13:42:31 +00:00
|
|
|
search_fields = ['name', 'organizer__name']
|
|
|
|
|
|
|
|
# Organize activities by start date
|
|
|
|
date_hierarchy = 'date_start'
|
|
|
|
ordering = ['-date_start']
|
|
|
|
|
|
|
|
|
|
|
|
class ActivityTypeAdmin(admin.ModelAdmin):
|
|
|
|
"""
|
|
|
|
Admin customisation for ActivityType
|
|
|
|
"""
|
|
|
|
list_display = ('name', 'can_invite', 'guest_entry_fee')
|
|
|
|
|
|
|
|
|
|
|
|
# Register your models here.
|
|
|
|
admin.site.register(Activity, ActivityAdmin)
|
|
|
|
admin.site.register(ActivityType, ActivityTypeAdmin)
|
|
|
|
admin.site.register(Guest)
|