Commit 6003acea authored by Jérome Perrin's avatar Jérome Perrin

describe getMovementHistoryList

parent 213876cf
......@@ -236,6 +236,21 @@ for brain in getInventoryList(node_uid=(alice.getUid(), bob.getUid()),
```
## getMovementHistoryList
`getMovementHistoryList` list all movements that form the inventory. The returned value is a list of `MovementHistoryListBrain` instances.
Continuing our example, `getMovementHistoryList` can be used to retrieve all the movements corresponding to an inventory, this can be used to explain
```python
print "Alice's has {inventory} candies".format(
inventory=getInventory(node_uid=alice.getUid(), resource_uid=candy.getUid())
print "The history is:"
for brain in getMovementHistoryList(node_uid=alice.getUid(), resource_uid=candy.getUid()):
if brain.quantity > 0:
print "On {date}, she recieved {quantity} candies from {mirror_section_title}".format(date=brain.date, quantity=brain.quantity, mirror_section_title=brain.mirror_section_title)
else:
print "On {date}, she gave {quantity} candies to {mirror_section_title}".format(date=brain.date, quantity=brain.quantity, mirror_section_title=brain.mirror_section_title)
```
## Complete List of supported parameters
### date
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment