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,
collection_class=set,
description=m.Computer.privacy.__doc__)
deposit = Integer(dump_only=True,
data_key='deposit',
deposit = Integer(validate=f.validate.Range(min=0, max=100),
description=m.Computer.deposit.__doc__)
# author_id = NestedOn(s_user.User,only_query='author_id')
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)
parents = NestedOn('Lot', many=True, dump_only=True)
url = URL(dump_only=True, description=m.Lot.url.__doc__)
deposit = f.Integer(dump_only=True,
data_key='deposit',
deposit = f.Integer(validate=f.validate.Range(min=0, max=100),
description=m.Lot.deposit.__doc__)
# author_id = NestedOn(s_user.User,only_query='author_id')
owner_address = SanitizedStr(validate=f.validate.Length(max=42))