28 lines
600 B
Python
28 lines
600 B
Python
from django.contrib import admin
|
|
|
|
from .models import Brand, Product, ProductStorage, Post, Image
|
|
|
|
|
|
admin.site.register(Brand)
|
|
admin.site.register(Product)
|
|
admin.site.register(ProductStorage)
|
|
admin.site.register(Image)
|
|
|
|
|
|
@admin.register(Post)
|
|
class PostAdmin(admin.ModelAdmin):
|
|
list_display = (
|
|
"product",
|
|
"color",
|
|
"storage",
|
|
"price",
|
|
"text",
|
|
"author",
|
|
"status",
|
|
"written_at",
|
|
)
|
|
list_filter = ("status", "written_at")
|
|
search_fields = ("product", "text")
|
|
date_hierarchy = "written_at"
|
|
raw_id_fields = ("author",)
|