Skip to content

Commit

Permalink
add base serializer for scenario dataset post payload #1890
Browse files Browse the repository at this point in the history
  • Loading branch information
jh-RLI committed Oct 21, 2024
1 parent 4ade232 commit 9f0815a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,18 @@ class Meta:
model = Table
# fields = ["id", "model_name", "acronym", "url"]
fields = ["id", "name", "human_readable_name", "url"]


class ScenarioBundleScenarioDatasetSerializer(serializers.Serializer):
scenario = serializers.UUIDField(required=True) # Validate the scenario UUID
dataset = serializers.ListField(
child=serializers.CharField(max_length=255), required=True
) # List of dataset table names
type = serializers.ChoiceField(
choices=["input", "output"], required=True
) # Type: input or output

def __getitem__(self, items):
print(type(items), items)
if items is None:
return None

0 comments on commit 9f0815a

Please sign in to comment.