Commit 78758af2 authored by Jérome Perrin's avatar Jérome Perrin

support limit= parameter in getMovementHistoryList


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29204 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7bd7710b
...@@ -69,6 +69,12 @@ ...@@ -69,6 +69,12 @@
</dictionary> </dictionary>
</value> </value>
</item> </item>
<item>
<key> <string>limit_expression</string> </key>
<value>
<dictionary/>
</value>
</item>
<item> <item>
<key> <string>omit_input</string> </key> <key> <string>omit_input</string> </key>
<value> <value>
...@@ -151,6 +157,7 @@ ...@@ -151,6 +157,7 @@
<string>where_expression</string> <string>where_expression</string>
<string>order_by_expression</string> <string>order_by_expression</string>
<string>group_by_expression</string> <string>group_by_expression</string>
<string>limit_expression</string>
<string>selection_domain</string> <string>selection_domain</string>
<string>selection_report</string> <string>selection_report</string>
<string>ignore_variation</string> <string>ignore_variation</string>
...@@ -587,6 +594,7 @@ ...@@ -587,6 +594,7 @@
where_expression\r\n where_expression\r\n
order_by_expression\r\n order_by_expression\r\n
group_by_expression\r\n group_by_expression\r\n
limit_expression\r\n
selection_domain\r\n selection_domain\r\n
selection_report\r\n selection_report\r\n
ignore_variation\r\n ignore_variation\r\n
...@@ -758,6 +766,12 @@ GROUP BY\n ...@@ -758,6 +766,12 @@ GROUP BY\n
ORDER BY\n ORDER BY\n
<dtml-var order_by_expression>\n <dtml-var order_by_expression>\n
</dtml-if>\n </dtml-if>\n
\n
<dtml-if limit_expression>\n
LIMIT\n
<dtml-var limit_expression>\n
</dtml-if>\n
\n
) AS q1\n ) AS q1\n
...@@ -918,6 +932,12 @@ GROUP BY\n ...@@ -918,6 +932,12 @@ GROUP BY\n
ORDER BY\n ORDER BY\n
<dtml-var order_by_expression>\n <dtml-var order_by_expression>\n
</dtml-if>\n </dtml-if>\n
\n
<dtml-if limit_expression>\n
LIMIT\n
<dtml-var limit_expression>\n
</dtml-if>\n
\n
) AS q1\n ) AS q1\n
......
1308 1309
\ No newline at end of file \ No newline at end of file
...@@ -1228,15 +1228,12 @@ class TestMovementHistoryList(InventoryAPITestCase): ...@@ -1228,15 +1228,12 @@ class TestMovementHistoryList(InventoryAPITestCase):
getMovementHistoryList(section_uid=self.section.getUid(), getMovementHistoryList(section_uid=self.section.getUid(),
sort_on=(('title', 'descending'),)) ]) sort_on=(('title', 'descending'),)) ])
# FIXME: do we want to include it or no ?
def test_Limit(self): def test_Limit(self):
return "is it part of this API ?" # XXX
getMovementHistoryList = self.getSimulationTool().getMovementHistoryList getMovementHistoryList = self.getSimulationTool().getMovementHistoryList
for q in range(10): for q in range(6):
self._makeMovement(quantity=1) self._makeMovement(quantity=1)
self.assertEquals(3, len(getMovementHistoryList(list_start=2, self.assertEquals(3, len(getMovementHistoryList(limit=3)))
list_lines=3))) self.assertEquals(4, len(getMovementHistoryList(limit=(1, 4))))
def test_SimulationState(self): def test_SimulationState(self):
getMovementHistoryList = self.getSimulationTool().getMovementHistoryList getMovementHistoryList = self.getSimulationTool().getMovementHistoryList
......
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