1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-24 07:08:48 +02:00

Prepare models for new chat feature

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello
2024-04-23 00:22:18 +02:00
parent 0bc5ef0a7f
commit 6546970c1e
14 changed files with 534 additions and 30 deletions

22
chat/admin.py Normal file
View File

@ -0,0 +1,22 @@
# Copyright (C) 2024 by Animath
# SPDX-License-Identifier: GPL-3.0-or-later
from django.contrib import admin
from .models import Channel, Message
@admin.register(Channel)
class ChannelAdmin(admin.ModelAdmin):
list_display = ('name', 'permission_type', 'tournament', 'pool', 'team',)
list_filter = ('permission_type', 'tournament',)
search_fields = ('name', 'tournament__name', 'team__name', 'team__trigram',)
autocomplete_fields = ('tournament', 'pool', 'team', )
@admin.register(Message)
class MessageAdmin(admin.ModelAdmin):
list_display = ('channel', 'author', 'created_at', 'updated_at', 'content',)
list_filter = ('channel', 'created_at', 'updated_at',)
search_fields = ('author__username', 'author__first_name', 'author__last_name', 'content',)
autocomplete_fields = ('channel', 'author',)