class ServerNodeQueryResponse(entity.Entity): """A response to a query about server-nodes.""" # If present, something went wrong, and this describes it. error = entity.Field('e', entity.OptionalStringValue(store_default=False)) # The set of servernodes. servers = entity.CompoundListField('s', ServerNodeEntry(), store_default=False)
class EntityTest(entity.Entity): """Testing...""" ival = entity.Field('i', entity.IntValue(default=345)) sval = entity.Field('s', entity.StringValue(default='svvv')) bval = entity.Field('b', entity.BoolValue(default=True)) fval = entity.Field('f', entity.FloatValue(default=1.0)) grp = entity.CompoundField('g', CompoundTest()) grp2 = entity.CompoundField('g2', CompoundTest2()) enumval = entity.Field('e', entity.EnumValue(EnumTest, default=None)) enumval2 = entity.Field( 'e2', entity.OptionalEnumValue(EnumTest, default=EnumTest.SECOND)) slval = entity.ListField('sl', entity.StringValue()) tval2 = entity.Field('t2', entity.DateTimeValue()) str_int_dict = entity.DictField('sd', str, entity.IntValue()) compoundlist = entity.CompoundListField('l', CompoundTest()) compoundlist2 = entity.CompoundListField('l2', CompoundTest()) compoundlist3 = entity.CompoundListField('l3', CompoundTest2()) compounddict = entity.CompoundDictField('td', str, CompoundTest()) compounddict2 = entity.CompoundDictField('td2', str, CompoundTest()) compounddict3 = entity.CompoundDictField('td3', str, CompoundTest2()) fval2 = entity.Field('f2', entity.Float3Value())
class CompoundTest(entity.CompoundValue): """Testing...""" isubval = entity.Field('i', entity.IntValue(default=34532)) compoundlist = entity.CompoundListField('l', SubCompoundTest())