feat: Add SKU field to ProductKit form for kit creation
- Added 'sku' field to ProductKitForm meta fields list - Added SKU label in form labels - Added SKU widget styling in __init__ method with helpful placeholder - Updated productkit_form.html template to display SKU field after name, before description - Updated form field filtering to exclude 'sku' from dynamic loop to prevent duplication 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -82,11 +82,12 @@ class ProductKitForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = ProductKit
|
||||
fields = [
|
||||
'name', 'description', 'categories',
|
||||
'name', 'sku', 'description', 'categories',
|
||||
'tags', 'pricing_method', 'fixed_price', 'markup_percent', 'markup_amount', 'is_active'
|
||||
]
|
||||
labels = {
|
||||
'name': 'Название',
|
||||
'sku': 'Артикул',
|
||||
'description': 'Описание',
|
||||
'categories': 'Категории',
|
||||
'tags': 'Теги',
|
||||
@@ -104,6 +105,10 @@ class ProductKitForm(forms.ModelForm):
|
||||
'class': 'form-control',
|
||||
'placeholder': 'Введите название комплекта'
|
||||
})
|
||||
self.fields['sku'].widget.attrs.update({
|
||||
'class': 'form-control',
|
||||
'placeholder': 'Артикул (необязательно, будет сгенерирован автоматически)'
|
||||
})
|
||||
self.fields['description'].widget.attrs.update({
|
||||
'class': 'form-control',
|
||||
'rows': 3
|
||||
|
||||
Reference in New Issue
Block a user