示例#1
0
class CowboyD(tests.IntAutoModel):
    farms = sheraf.LargeListAttribute(sheraf.ModelAttribute("FarmD")).index()

    farm_size = sheraf.Index(farms)

    @farm_size.search
    def search_farm_size(self, size):
        return size

    @farm_size.values
    def index_farm_size(self, farms):
        return {farm.size for farm in farms}
示例#2
0
 class Model(tests.UUIDAutoModel):
     foo = sheraf.SimpleAttribute()
     mylist = sheraf.LargeListAttribute()
示例#3
0
class UniqueListParent(tests.IntAutoModel):
    children = sheraf.LargeListAttribute(
        sheraf.ModelAttribute("UniqueListChild")).index(unique=True)
示例#4
0
class MultiListParent(tests.UUIDAutoModel):
    children = sheraf.LargeListAttribute(
        sheraf.ModelAttribute("MultiListChild")).index()
示例#5
0
class BadParent(tests.UUIDAutoModel):
    child = sheraf.LargeListAttribute(sheraf.SimpleAttribute()).index()
示例#6
0
 class Model(tests.UUIDAutoModel):
     something = sheraf.attributes.simples.SimpleAttribute()
     something_else = sheraf.attributes.simples.SimpleAttribute()
     stuff = sheraf.LargeListAttribute(lazy=False)
示例#7
0
 class Model(tests.UUIDAutoModel):
     order = sheraf.SimpleAttribute()
     stuff = sheraf.LargeListAttribute(lazy=False)