add fields to serializer
This commit is contained in:
parent
0925d87a00
commit
5af3b95c8d
1 changed files with 12 additions and 3 deletions
|
|
@ -13,9 +13,9 @@ class PredictionSerializer(serializers.ModelSerializer):
|
|||
|
||||
|
||||
PROFILE_STANDARD = "standard_profile"
|
||||
PROFILE_FLOAT = "float"
|
||||
PROFILE_REVERSE = "reverse"
|
||||
PROFILE_CUSTOM = "custom"
|
||||
PROFILE_FLOAT = "float_profile"
|
||||
PROFILE_REVERSE = "reverse_profile"
|
||||
PROFILE_CUSTOM = "custom_profile"
|
||||
LATEST_DATASET_KEYWORD = "latest"
|
||||
SUPPORTED_PROFILES = [PROFILE_STANDARD, PROFILE_FLOAT, PROFILE_REVERSE, PROFILE_CUSTOM]
|
||||
|
||||
|
|
@ -38,6 +38,15 @@ class PredictionRequestSerializer(serializers.Serializer):
|
|||
ascent_curve = serializers.CharField(required=False)
|
||||
descent_curve = serializers.CharField(required=False)
|
||||
interpolate = serializers.BooleanField(required=False, default=False)
|
||||
start_point = serializers.PrimaryKeyRelatedField(
|
||||
queryset=SavedPoint.objects.all(), required=False, allow_null=True
|
||||
)
|
||||
rate_profile = serializers.PrimaryKeyRelatedField(
|
||||
queryset=SavedRateProfile.objects.all(), required=False, allow_null=True
|
||||
)
|
||||
template = serializers.PrimaryKeyRelatedField(
|
||||
queryset=PreditctionTemplate.objects.all(), required=False, allow_null=True
|
||||
)
|
||||
|
||||
def validate(self, data):
|
||||
profile = data.get("profile", PROFILE_STANDARD)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue