class AllBasicTypesModel(apilib.Model): fstring = apilib.Field(apilib.String()) fint = apilib.Field(apilib.Integer()) ffloat = apilib.Field(apilib.Float()) fbool = apilib.Field(apilib.Boolean()) fdate = apilib.Field(apilib.Date()) fdatetime = apilib.Field(apilib.DateTime()) fdecimal = apilib.Field(apilib.Decimal()) fenum = apilib.Field(apilib.Enum(['Jerry', 'George'])) fid = apilib.Field(apilib.EncryptedId())
class ModelWithValidators(apilib.Model): fstring = apilib.Field(apilib.String(), required=True, description='This is a custom description') fint = apilib.Field(apilib.Integer(), required='mutate', custom_attr='This is a custom attr') ffloat = apilib.Field(apilib.Float(), required=['get', 'mutate']) fbool = apilib.Field(apilib.Boolean(), required=['mutate/UPDATE', 'mutate/DELETE']) freadonly = apilib.Field(apilib.String(), readonly=True)
class ToStringModel(apilib.Model): fstring = apilib.Field(apilib.String()) fint = apilib.Field(apilib.Integer()) ffloat = apilib.Field(apilib.Float()) fbool = apilib.Field(apilib.Boolean()) fdate = apilib.Field(apilib.Date()) fdatetime = apilib.Field(apilib.DateTime()) fdecimal = apilib.Field(apilib.Decimal()) fenum = apilib.Field(apilib.Enum(['JERRY', 'GEORGE'])) fbytes = apilib.Field(apilib.Bytes()) fchild = apilib.Field(apilib.ModelType(BasicScalarModel)) lchild = apilib.Field(apilib.ListType(BasicScalarModel)) dchild = apilib.Field(apilib.DictType(BasicScalarModel))
class ScalarListModel(apilib.Model): lstring = apilib.Field(apilib.ListType(apilib.String())) lint = apilib.Field(apilib.ListType(apilib.Integer())) lfloat = apilib.Field(apilib.ListType(apilib.Float())) lbool = apilib.Field(apilib.ListType(apilib.Boolean()))
class ScalarDictModel(apilib.Model): dstring = apilib.Field(apilib.DictType(apilib.String())) dint = apilib.Field(apilib.DictType(apilib.Integer())) dfloat = apilib.Field(apilib.DictType(apilib.Float())) dbool = apilib.Field(apilib.DictType(apilib.Boolean()))
class BasicScalarModel(apilib.Model): fstring = apilib.Field(apilib.String()) fint = apilib.Field(apilib.Integer()) ffloat = apilib.Field(apilib.Float()) fbool = apilib.Field(apilib.Boolean())
class Model(apilib.Model): fstring = apilib.Field(apilib.String(), readonly=True) fint = apilib.Field(apilib.Integer(), readonly=True) ffloat = apilib.Field(apilib.Float(), readonly=True) fbool = apilib.Field(apilib.Boolean(), readonly=True)
class Model(apilib.Model): fbool = apilib.Field(apilib.Boolean(), required=True)