haha
This commit is contained in:
@@ -108,12 +108,6 @@ class FilterConfigSerializer(serializers.ModelSerializer):
|
||||
fields = "__all__"
|
||||
read_only_fields = ["id", "created_at", "updated_at"]
|
||||
|
||||
def to_representation(self, instance):
|
||||
"""响应中 is_active 统一为字符串 "true" / "false"。"""
|
||||
data = super().to_representation(instance)
|
||||
data["is_active"] = "true" if instance.is_active else "false"
|
||||
return data
|
||||
|
||||
def to_internal_value(self, data):
|
||||
"""请求中兼容 minAmount/maxAmount、最小金额/最大金额 等别名,统一为 min_amount/max_amount。"""
|
||||
if isinstance(data, dict):
|
||||
|
||||
Reference in New Issue
Block a user