[IMP] api: compute methods cannot depend on field 'id'

This feature hasn't been implemented because of complexity problems.
Therefore, we should not allow the developer to use it.
This commit is contained in:
Samus CTO 2014-09-04 09:30:43 +02:00 committed by Raphael Collet
parent 51e7e03502
commit 176e14d2bc
1 changed files with 2 additions and 0 deletions

View File

@ -191,6 +191,8 @@ def depends(*args):
"""
if args and callable(args[0]):
args = args[0]
elif any('id' in arg.split('.') for arg in args):
raise NotImplementedError("Compute method cannot depend on field 'id'.")
return lambda method: decorate(method, '_depends', args)