bot dev
This commit is contained in:
23
bot/admin.py
23
bot/admin.py
@@ -1,3 +1,24 @@
|
||||
from django.contrib import admin
|
||||
from .models import TelegramBot, BotConfig, TelegramChat
|
||||
|
||||
# Register your models here.
|
||||
|
||||
@admin.register(TelegramBot)
|
||||
class TelegramBotAdmin(admin.ModelAdmin):
|
||||
list_display = ("id", "name", "username", "is_active")
|
||||
list_filter = ("is_active",)
|
||||
search_fields = ("name", "username")
|
||||
|
||||
|
||||
@admin.register(BotConfig)
|
||||
class BotConfigAdmin(admin.ModelAdmin):
|
||||
list_display = ("id", "bot", "parse_mode", "use_webhook")
|
||||
list_filter = ("use_webhook", "parse_mode")
|
||||
autocomplete_fields = ("bot",)
|
||||
|
||||
|
||||
@admin.register(TelegramChat)
|
||||
class TelegramChatAdmin(admin.ModelAdmin):
|
||||
list_display = ("id", "type", "title", "username", "is_member", "joined_at", "left_at", "last_message_at")
|
||||
list_filter = ("type", "is_member")
|
||||
search_fields = ("title", "username")
|
||||
readonly_fields = ("joined_at", "left_at", "last_message_at")
|
||||
|
||||
Reference in New Issue
Block a user