Пример #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)