rebuild of detail of product
This commit is contained in:
@@ -119,6 +119,14 @@ class DetailModelAdmin(ModelAdmin, ImportExportModelAdmin):
|
||||
"widget": ArrayWidget,
|
||||
}
|
||||
}
|
||||
|
||||
class DetailInLine(StackedInline):
|
||||
model = DetailModel
|
||||
extra = 0
|
||||
show_change_link = True
|
||||
min_num = 1
|
||||
max_num = 4
|
||||
|
||||
@admin.register(ProductDetailModel)
|
||||
class ProductDetailModel1Admin(ModelAdmin, ImportExportModelAdmin):
|
||||
import_form_class = ImportForm
|
||||
@@ -126,7 +134,8 @@ class ProductDetailModel1Admin(ModelAdmin, ImportExportModelAdmin):
|
||||
search_fields = ['detail_category__title', 'name']
|
||||
compressed_fields = True
|
||||
warn_unsaved_form = True
|
||||
|
||||
autocomplete_fields = ['detail_category',]
|
||||
inlines = [DetailInLine]
|
||||
formfield_overrides = {
|
||||
ArrayField: {
|
||||
"widget": ArrayWidget,
|
||||
|
||||
Reference in New Issue
Block a user