Makes deposit writable and applies range check from

0-100
This commit is contained in:
emmdim 2019-12-19 12:27:02 +01:00 committed by nad
parent dd82f0e2d9
commit 2175cd5efa
2 changed files with 2 additions and 4 deletions

View File

@ -122,8 +122,7 @@ class Computer(Device):
dump_only=True, dump_only=True,
collection_class=set, collection_class=set,
description=m.Computer.privacy.__doc__) description=m.Computer.privacy.__doc__)
deposit = Integer(dump_only=True, deposit = Integer(validate=f.validate.Range(min=0, max=100),
data_key='deposit',
description=m.Computer.deposit.__doc__) description=m.Computer.deposit.__doc__)
# author_id = NestedOn(s_user.User,only_query='author_id') # author_id = NestedOn(s_user.User,only_query='author_id')
owner_address = SanitizedStr(validate=f.validate.Length(max=42)) owner_address = SanitizedStr(validate=f.validate.Length(max=42))

View File

@ -18,8 +18,7 @@ class Lot(Thing):
children = NestedOn('Lot', many=True, dump_only=True) children = NestedOn('Lot', many=True, dump_only=True)
parents = NestedOn('Lot', many=True, dump_only=True) parents = NestedOn('Lot', many=True, dump_only=True)
url = URL(dump_only=True, description=m.Lot.url.__doc__) url = URL(dump_only=True, description=m.Lot.url.__doc__)
deposit = f.Integer(dump_only=True, deposit = f.Integer(validate=f.validate.Range(min=0, max=100),
data_key='deposit',
description=m.Lot.deposit.__doc__) description=m.Lot.deposit.__doc__)
# author_id = NestedOn(s_user.User,only_query='author_id') # author_id = NestedOn(s_user.User,only_query='author_id')
owner_address = SanitizedStr(validate=f.validate.Length(max=42)) owner_address = SanitizedStr(validate=f.validate.Length(max=42))