schon/core/forms.py
Egor fureunoir Gorbunov e0b2f183ce Features: 1) Extend fieldsets by adding additional_fields support in FieldsetsMixin; 2) Add CRMForm for CustomerRelationshipManagementProviderAdmin; 3) Improve Order.__str__ to use human_readable_id for better debugging context;
Fixes: 1) Replace misplaced imports in `core/admin.py` for proper organization;

Extra: Adjust admin fieldsets for consistency, formatting, and search enhancements; Minor contributions to migration file cleanup.
2025-10-13 16:27:47 +03:00

52 lines
1.1 KiB
Python

from django import forms
from .models import Order, OrderProduct, Product, Vendor
from .widgets import JSONTableWidget
class ProductForm(forms.ModelForm):
class Meta:
model = Product
fields = "__all__"
widgets = {
"attributes": JSONTableWidget(),
}
class VendorForm(forms.ModelForm):
class Meta:
model = Vendor
fields = "__all__"
widgets = {
"authentication": JSONTableWidget(),
}
class CRMForm(forms.ModelForm):
class Meta:
model = Product
fields = "__all__"
widgets = {
"authentication": JSONTableWidget(),
"attributes": JSONTableWidget(),
}
class OrderProductForm(forms.ModelForm):
class Meta:
model = OrderProduct
fields = "__all__"
widgets = {
"notifications": JSONTableWidget(),
"attributes": JSONTableWidget(),
}
class OrderForm(forms.ModelForm):
class Meta:
model = Order
fields = "__all__"
widgets = {
"notifications": JSONTableWidget(),
"attributes": JSONTableWidget(),
}