Add 'bot_banner' field to ProductModel and create BotProductDetailView for bot integration

This commit is contained in:
Parsa Nazer
2025-08-05 00:13:47 +03:30
parent d9b6655ee8
commit e9b1666423
5 changed files with 34 additions and 5 deletions
+2 -2
View File
@@ -191,14 +191,14 @@ class ProductModelAdmin(ModelAdmin, ImportExportModelAdmin):
inlines = [ProductVariantInLine]
readonly_fields = ('slug', 'created_at')
search_fields = ['name', 'description', ]
list_filter = ['show', 'category']
list_filter = ['show', 'category', 'show_in_bot']
autocomplete_fields = ['related_products', 'shop']
# compressed_fields = True
warn_unsaved_form = True
actions_list = ['redirect_to_learn', 'update_products_price']
list_display = ['display_image', 'display_price', 'view', 'show', 'rating', 'category', 'created_at']
fieldsets = (
('فیلد های اصلی', {'fields': ('name', 'description', 'category', 'related_products', 'show', 'shop', 'show_in_bot'), "classes": ["tab"],}),
('فیلد های اصلی', {'fields': ('name', 'description', 'category', 'related_products', 'show', 'shop', 'show_in_bot', 'bot_banner'), "classes": ["tab"],}),
('فیلد های سيو', {'fields': ('meta_description', 'meta_keywords', 'meta_rating', 'slug'), "classes": ["tab"],}),
('فیلد های مربوط به کاربر', {'fields': ('rating', 'view',), "classes": ["tab"],}),
# ('فیلد های ایتم های پک', {'fields': ('in_pack_items', ), "classes": ["tab"],})