Esempio n. 1
0
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())
Esempio n. 2
0
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)
Esempio n. 3
0
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))
Esempio n. 4
0
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()))
Esempio n. 5
0
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()))
Esempio n. 6
0
class BasicScalarModel(apilib.Model):
    fstring = apilib.Field(apilib.String())
    fint = apilib.Field(apilib.Integer())
    ffloat = apilib.Field(apilib.Float())
    fbool = apilib.Field(apilib.Boolean())
Esempio n. 7
0
 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)
Esempio n. 8
0
 class Model(apilib.Model):
     fbool = apilib.Field(apilib.Boolean(), required=True)