feat: MVP-скелет площадки (Django + MySQL/SQLite, модели по ТЗ §4, базовые страницы)
This commit is contained in:
1 parent
e5f312a00f
commit
8218a568ce
67 files changed
+1929
No files matched your search
@@ -0,0 +1,31 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from .models import Article, Banner, Collection, NewsEvent
|
||||
|
||||
|
||||
@admin.register(Collection)
|
||||
class CollectionAdmin(admin.ModelAdmin):
|
||||
list_display = ('name', 'is_published', 'published_at')
|
||||
list_filter = ('is_published',)
|
||||
filter_horizontal = ('products',)
|
||||
prepopulated_fields = {'slug': ('name',)}
|
||||
|
||||
|
||||
@admin.register(Article)
|
||||
class ArticleAdmin(admin.ModelAdmin):
|
||||
list_display = ('title', 'brand', 'published_at')
|
||||
search_fields = ('title',)
|
||||
prepopulated_fields = {'slug': ('title',)}
|
||||
|
||||
|
||||
@admin.register(NewsEvent)
|
||||
class NewsEventAdmin(admin.ModelAdmin):
|
||||
list_display = ('title', 'event_date', 'is_published', 'published_at')
|
||||
list_filter = ('is_published',)
|
||||
prepopulated_fields = {'slug': ('title',)}
|
||||
|
||||
|
||||
@admin.register(Banner)
|
||||
class BannerAdmin(admin.ModelAdmin):
|
||||
list_display = ('title', 'url', 'sort_order', 'is_active')
|
||||
list_filter = ('is_active',)
|
||||
Reference in new issue
Block a user