Beispiel #1
0
        class ObjSerializer(Serializer):
            class Meta:
                model = Obj

            objfield = StringField(name="objField", required=True, allow_null=False)
            subobjs = ListField(ObjectField(SubObjSerializer, required=True, allow_null=False),
                                name="subObjs", required=True, allow_null=False)
Beispiel #2
0
        class ObjSerializer(Serializer):
            class Meta:
                model = Obj

            string_field = StringField(name="stringField",
                                       required=True,
                                       allow_null=False)
Beispiel #3
0
        class ObjSerializer(Serializer):
            class Meta:
                model = Obj

            string_field = StringField(name="stringField", required=True, allow_null=False)
            integer_field = IntegerField(name="integerField", required=True, allow_null=False)
            float_field = FloatField(name="floatField", required=True, allow_null=False)
            boolean_field = BooleanField(name="boolField", required=True, allow_null=False)
            datetime_field = DateTimeField(name="datetimeField", required=True, allow_null=False)
            iso_datetime_field = InternetDateTimeField(name="isoDatetimeField", required=True, allow_null=False)
            date_field = DateField(name="dateField", required=True, allow_null=False)
            time_field = TimeField(name="timeField", required=True, allow_null=False)
            uuid_field = UuidField(name="uuidField", required=True, allow_null=False)
Beispiel #4
0
        class SubObjSerializer(Serializer):
            class Meta:
                model = SubObj

            field = StringField()
Beispiel #5
0
        class ObjSerializer(Serializer):
            class Meta:
                model = Obj

            sub_obj = ObjectField(SubObjSerializer, required=True, allow_null=False)
            list_field = ListField(StringField(), required=True, allow_null=False)
Beispiel #6
0
        class SubObjSerializer(Serializer):
            class Meta:
                model = SubObj

            field = StringField(required=True, allow_null=False)
Beispiel #7
0
 class ObjSerializer(Serializer):
     enum_field = StringField(validators=[EnumValidator("hi", "bye")])
Beispiel #8
0
 class SubSerializer(Serializer):
     field = StringField()
Beispiel #9
0
 class ObjSerializer(Serializer):
     list_field = ListField(StringField(), required=True, allow_null=False)
Beispiel #10
0
        class SubObjSerializer(Serializer):
            class Meta:
                model = SubObj

            field = StringField(required=True)