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())
Exemple #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)
Exemple #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))
Exemple #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()))
Exemple #5
0
class NGrandchild(apilib.Model):
    fint = apilib.Field(apilib.Integer())
    lfloat = apilib.Field(apilib.ListType(apilib.Float()))
Exemple #6
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()))
Exemple #7
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())
 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):
     fint = apilib.Field(apilib.Integer(), required=True)
     ffloat = apilib.Field(apilib.Float(), required=True)