# Path: bot/plugins/custom_commands/models.py
# class Command(models.Model):
#     command = models.CharField(
#         _('command'), max_length=50,
#         help_text=_('trigger for the command, e.g. \'benis\''),
#         validators=[no_prefix_at_beginning]
#     )
#     description = models.CharField(_('description'), max_length=255, blank=True)
# 
#     class Meta:
#         verbose_name = _('command')
#         verbose_name_plural = _('commands')
# 
#     def __str__(self):
#         return "{}{}".format(PREFIX, self.command)
# 
# class CommandAction(models.Model):
#     command = models.ForeignKey(Command, on_delete=models.CASCADE)
#     action = models.TextField(_('action'), help_text=_('Text to be replied'))
# 
#     class Meta:
#         verbose_name = _('command action')
#         verbose_name_plural = _('command actions')
# 
#     def __str__(self):
#         return self.action[:30]


from django.contrib import admin
from .models import Command, CommandAction



class CommandActionInline(admin.TabularInline):
    model = CommandAction
    extra = 1


@admin.register(Command)
class CommandAdmin(admin.ModelAdmin):

# Path: bot/plugins/custom_commands/models.py
# class Command(models.Model):
#     command = models.CharField(
#         _('command'), max_length=50,
#         help_text=_('trigger for the command, e.g. \'benis\''),
#         validators=[no_prefix_at_beginning]
#     )
#     description = models.CharField(_('description'), max_length=255, blank=True)
# 
#     class Meta:
#         verbose_name = _('command')
#         verbose_name_plural = _('commands')
# 
#     def __str__(self):
#         return "{}{}".format(PREFIX, self.command)
# 
# class CommandAction(models.Model):
#     command = models.ForeignKey(Command, on_delete=models.CASCADE)
#     action = models.TextField(_('action'), help_text=_('Text to be replied'))
# 
#     class Meta:
#         verbose_name = _('command action')
#         verbose_name_plural = _('command actions')
# 
#     def __str__(self):
#         return self.action[:30]


# Path: bot/plugins/custom_commands/admin.py
from django.contrib import admin
from .models import Command, CommandAction




class CommandActionInline(admin.TabularInline):
    model = CommandAction
    extra = 1


@admin.register(Command)
class CommandAdmin(admin.ModelAdmin):

    list_display = ['__str__', 'description']