adminka togirlandi
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
from django.contrib import admin
|
||||
from unfold.admin import ModelAdmin # noqa
|
||||
|
||||
from apps.geology.models import Category
|
||||
|
||||
|
||||
@admin.register(Category)
|
||||
class CategoryAdmin(ModelAdmin):
|
||||
class CategoryAdmin(admin.ModelAdmin):
|
||||
list_display = ("name", "created_at", "updated_at")
|
||||
search_fields = ("name",)
|
||||
list_filter = ("created_at", "updated_at")
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
from django.contrib import admin
|
||||
from unfold.admin import ModelAdmin
|
||||
|
||||
from apps.geology.models import GalleryCategory, Gallery
|
||||
|
||||
|
||||
@admin.register(GalleryCategory)
|
||||
class GalleryCategoryAdmin(ModelAdmin):
|
||||
class GalleryCategoryAdmin(admin.ModelAdmin):
|
||||
list_display = ("id", "name", "created_at", "updated_at")
|
||||
search_fields = ("name",)
|
||||
filter_horizontal = ("gallery",)
|
||||
list_filter = ("created_at", "updated_at")
|
||||
exclude = ("count",)
|
||||
|
||||
|
||||
@admin.register(Gallery)
|
||||
class GalleryAdmin(ModelAdmin):
|
||||
class GalleryAdmin(admin.ModelAdmin):
|
||||
list_display = ("id", "name", "created_at", "updated_at")
|
||||
search_fields = ("name",)
|
||||
list_filter = ("created_at", "updated_at")
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
from django.contrib import admin
|
||||
from unfold.admin import ModelAdmin # noqa
|
||||
|
||||
from apps.geology.models import Geology
|
||||
|
||||
|
||||
@admin.register(Geology)
|
||||
class GeologyAdmin(ModelAdmin):
|
||||
class GeologyAdmin(admin.ModelAdmin):
|
||||
list_display = ("name", "category", "created_at", "updated_at")
|
||||
search_fields = ("name", "title", "body1", "body2", "body3")
|
||||
list_filter = ("category", "created_at", "updated_at")
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
from django.contrib import admin
|
||||
from unfold.admin import ModelAdmin # noqa
|
||||
|
||||
from apps.geology.models import Photo
|
||||
|
||||
|
||||
@admin.register(Photo)
|
||||
class PhotoAdmin(ModelAdmin):
|
||||
class PhotoAdmin(admin.ModelAdmin):
|
||||
list_display = ("name", "description", "type", "size", "image", "created_at")
|
||||
search_fields = ("name", "description", "type", "size", "image")
|
||||
list_filter = ("type",)
|
||||
|
||||
Reference in New Issue
Block a user