50 lines
1.7 KiB
Python
50 lines
1.7 KiB
Python
from django.contrib import admin
|
|
from .models import *
|
|
|
|
|
|
class ProgrammerAdmin(admin.ModelAdmin):
|
|
list_display = ('id', 'title', 'time_create', 'photo', 'is_published')
|
|
list_display_links = ('id', 'title')
|
|
search_fields = ('title', 'content')
|
|
list_editable = ('is_published',)
|
|
list_filter = ('time_create', 'is_published')
|
|
|
|
|
|
class RecallAdmin(admin.ModelAdmin):
|
|
list_display = ('id', 'title', 'time_create', 'scan', 'is_published')
|
|
list_display_links = ('id', 'title')
|
|
search_fields = ('title', 'content')
|
|
list_editable = ('is_published',)
|
|
list_filter = ('time_create', 'is_published')
|
|
|
|
|
|
class SolutionAdmin(admin.ModelAdmin):
|
|
list_display = ('id', 'title', 'time_create', 'is_published')
|
|
list_display_links = ('id', 'title')
|
|
search_fields = ('title', 'description', 'implementation')
|
|
list_editable = ('is_published',)
|
|
list_filter = ('time_create', 'is_published')
|
|
|
|
|
|
class HomeAdmin(admin.ModelAdmin):
|
|
list_display = ('id', 'title', 'time_create', 'is_published')
|
|
list_display_links = ('id', 'title')
|
|
search_fields = ('title', 'content')
|
|
list_editable = ('is_published',)
|
|
list_filter = ('time_create', 'is_published')
|
|
|
|
|
|
@admin.register(CallbackRequest)
|
|
class CallbackAdmin(admin.ModelAdmin):
|
|
list_display = ('name', 'phone', 'email', 'time_create', 'is_processed')
|
|
list_display_links = ('name', 'phone')
|
|
list_editable = ('is_processed',)
|
|
list_filter = ('time_create', 'is_processed')
|
|
search_fields = ('name', 'phone', 'email')
|
|
readonly_fields = ('time_create',)
|
|
|
|
admin.site.register(Competence, ProgrammerAdmin)
|
|
admin.site.register(Recall, RecallAdmin)
|
|
admin.site.register(Solution, SolutionAdmin)
|
|
admin.site.register(Home, HomeAdmin)
|