class TestValidation(BaseSerializer):

            choices = fields.StringField(choices=["1", "2", "3"],
                                         required=True)
            not_req = fields.StringField()
            boolean = fields.BooleanField(required=True)
            boolean_not_req = fields.BooleanField()
            string_def = fields.StringField(default="", required=True)
            dt = fields.DateTimeField()
예제 #2
0
        class S(BaseSerializer):

            field = fields.StringField(required=True)
예제 #3
0
        class SimpleSerializer(BaseSerializer):

            value = fields.StringField(
                validators=[UniqueValidator(qs=UniqueCol.objects.all())])
예제 #4
0
        class S(BaseSerializer):

            value = fields.StringField()
            created = fields.DateTimeField(read_only=True)
        class TestSerializer(BaseSerializer):

            field = fields.StringField(required=True)

            class Meta:
                allow_additional_fields = True
예제 #6
0
 class Nested(BaseSerializer):
     value = fields.StringField()