from django.contrib import admin
from webapp import models


admin.site.register(models.Comment)
admin.site.register(models.Tag)


@admin.register(models.Article)
class ArticleAdmin(admin.ModelAdmin):
    list_display = ('id', 'title', 'author', 'created_at')
    list_filter = ('author', 'created_at')
    search_fields = ('title', 'text')
    fields = ('title', 'author', 'text', 'created_at', 'updated_at')
    readonly_fields = ('created_at', 'updated_at')
