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)
class ObjSerializer(Serializer): class Meta: model = Obj string_field = StringField(name="stringField", required=True, allow_null=False)
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)
class SubObjSerializer(Serializer): class Meta: model = SubObj field = StringField()
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)
class SubObjSerializer(Serializer): class Meta: model = SubObj field = StringField(required=True, allow_null=False)
class ObjSerializer(Serializer): enum_field = StringField(validators=[EnumValidator("hi", "bye")])
class SubSerializer(Serializer): field = StringField()
class ObjSerializer(Serializer): list_field = ListField(StringField(), required=True, allow_null=False)
class SubObjSerializer(Serializer): class Meta: model = SubObj field = StringField(required=True)