diff --git a/core/admin.py b/core/admin.py index 19ef4b34..19e93156 100644 --- a/core/admin.py +++ b/core/admin.py @@ -1,31 +1,15 @@ from django.contrib import admin + from .models import TokenPrice class UserConstraintBaseAdmin(admin.ModelAdmin): - fields = [ - 'name', - 'title', - 'type', - 'description', - 'response', - "icon_url" - ] - list_display = [ - "pk", - "name", - "description" - ] + fields = ["name", "title", "type", "description", "explanation", "response", "icon_url"] + list_display = ["pk", "name", "description"] class TokenPriceAdmin(admin.ModelAdmin): - list_display = [ - 'symbol', - 'usd_price', - 'price_url', - 'datetime', - 'last_updated' - ] + list_display = ["symbol", "usd_price", "price_url", "datetime", "last_updated"] list_filter = ["symbol"] diff --git a/core/serializers.py b/core/serializers.py index 8fede6c6..6cca8ca0 100644 --- a/core/serializers.py +++ b/core/serializers.py @@ -11,13 +11,24 @@ class UserConstraintBaseSerializer(serializers.Serializer): title = serializers.CharField() type = serializers.ChoiceField(choices=UserConstraint.Type.choices) description = serializers.CharField() + explanation = serializers.CharField() response = serializers.CharField() icon_url = serializers.CharField() params = serializers.SerializerMethodField() class Meta: - fields = ["pk", "name", "title", "type", "description", "response", "icon_url", "params"] - read_only_fields = ["pk", "name", "title", "type", "description", "response", "icon_url", "params"] + fields = ["pk", "name", "title", "type", "description", "explanation", "response", "icon_url", "params"] + read_only_fields = [ + "pk", + "name", + "title", + "type", + "description", + "explanation", + "response", + "icon_url", + "params", + ] def get_params(self, constraint: UserConstraint): c_class: ConstraintVerification = get_constraint(constraint.name)