list filter and search fields
This commit is contained in:
@@ -24,7 +24,8 @@ class ProductModelAdmin(ModelAdmin, ImportExportModelAdmin):
|
||||
export_form_class = ExportForm
|
||||
inlines = [InStuckColorsInLine]
|
||||
readonly_fields = ('slug', )
|
||||
search_fields = ['name']
|
||||
search_fields = ['name', 'description', ]
|
||||
list_filter = ['currency', 'show', 'category']
|
||||
autocomplete_fields = ['related_products']
|
||||
# compressed_fields = True
|
||||
warn_unsaved_form = True
|
||||
@@ -81,7 +82,7 @@ class MainCategoryModelAdmin(ModelAdmin, ImportExportModelAdmin):
|
||||
export_form_class = ExportForm
|
||||
list_display = ['name', ]
|
||||
readonly_fields = ('slug', )
|
||||
|
||||
search_fields = ['name', 'slug']
|
||||
compressed_fields = True
|
||||
warn_unsaved_form = True
|
||||
|
||||
@@ -95,6 +96,9 @@ class MainCategoryModelAdmin(ModelAdmin, ImportExportModelAdmin):
|
||||
class SubCategoryModelAdmin(ModelAdmin, ImportExportModelAdmin):
|
||||
list_display = ['name', 'parent', 'show']
|
||||
|
||||
search_fields = ['name', 'slug']
|
||||
list_filter = ['parent', 'show', ]
|
||||
|
||||
import_form_class = ImportForm
|
||||
export_form_class = ExportForm
|
||||
|
||||
@@ -114,7 +118,8 @@ class CommentAdmin(ModelAdmin, ImportExportModelAdmin):
|
||||
import_form_class = ImportForm
|
||||
export_form_class = ExportForm
|
||||
list_display = ['user', 'product', 'display_content','show']
|
||||
|
||||
search_fields = ['content',]
|
||||
list_filter = ['show',]
|
||||
compressed_fields = True
|
||||
warn_unsaved_form = True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user