1
0
mirror of https://gitlab.crans.org/mediatek/med.git synced 2024-11-30 09:33:03 +00:00
med/media/admin.py

31 lines
838 B
Python
Raw Normal View History

2019-08-02 12:57:53 +00:00
# -*- mode: python; coding: utf-8 -*-
# Copyright (C) 2017-2019 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later
2017-06-30 01:25:07 +00:00
from django.contrib import admin
2019-08-02 12:57:53 +00:00
from reversion.admin import VersionAdmin
2017-06-30 01:25:07 +00:00
2017-07-03 16:33:24 +00:00
from .models import Auteur, Emprunt, Media, Jeu
2017-06-30 01:25:07 +00:00
2019-08-02 12:57:53 +00:00
2017-06-30 01:25:07 +00:00
class AuteurAdmin(VersionAdmin):
list_display = ('nom',)
2019-08-02 12:57:53 +00:00
2017-06-30 01:25:07 +00:00
class MediaAdmin(VersionAdmin):
2019-08-02 12:57:53 +00:00
list_display = ('titre', 'cote')
2017-06-30 01:25:07 +00:00
class EmpruntAdmin(VersionAdmin):
2019-08-02 12:57:53 +00:00
list_display = ('media', 'user', 'date_emprunt', 'date_rendu', 'permanencier_emprunt', 'permanencier_rendu')
2017-06-30 01:25:07 +00:00
2017-07-03 16:33:24 +00:00
class JeuAdmin(VersionAdmin):
2019-08-02 12:57:53 +00:00
list_display = ('nom', 'proprietaire', 'duree', 'nombre_joueurs_min', 'nombre_joueurs_max', 'comment')
2017-06-30 01:25:07 +00:00
admin.site.register(Auteur, AuteurAdmin)
admin.site.register(Media, MediaAdmin)
admin.site.register(Emprunt, EmpruntAdmin)
2017-07-03 16:33:24 +00:00
admin.site.register(Jeu, JeuAdmin)