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}
class Model(tests.UUIDAutoModel): foo = sheraf.SimpleAttribute() mylist = sheraf.LargeListAttribute()
class UniqueListParent(tests.IntAutoModel): children = sheraf.LargeListAttribute( sheraf.ModelAttribute("UniqueListChild")).index(unique=True)
class MultiListParent(tests.UUIDAutoModel): children = sheraf.LargeListAttribute( sheraf.ModelAttribute("MultiListChild")).index()
class BadParent(tests.UUIDAutoModel): child = sheraf.LargeListAttribute(sheraf.SimpleAttribute()).index()
class Model(tests.UUIDAutoModel): something = sheraf.attributes.simples.SimpleAttribute() something_else = sheraf.attributes.simples.SimpleAttribute() stuff = sheraf.LargeListAttribute(lazy=False)
class Model(tests.UUIDAutoModel): order = sheraf.SimpleAttribute() stuff = sheraf.LargeListAttribute(lazy=False)