--- a/doc/book/en/annexes/rql/language.rst Tue Oct 25 18:59:15 2011 +0200
+++ b/doc/book/en/annexes/rql/language.rst Wed Oct 26 14:12:35 2011 +0200
@@ -111,16 +111,15 @@
Mathematical operators
``````````````````````
-::
-+==========+=====================+===========+========+
++----------+---------------------+-----------+--------+
| Operator | Description | Example | Result |
+==========+=====================+===========+========+
-| + | addition | 2 + 3 | 5 |
+| `+` | addition | 2 + 3 | 5 |
+----------+---------------------+-----------+--------+
-| - | subtraction | 2 - 3 | -1 |
+| `-` | subtraction | 2 - 3 | -1 |
+----------+---------------------+-----------+--------+
-| * | multiplication | 2 * 3 | 6 |
+| `*` | multiplication | 2 * 3 | 6 |
+----------+---------------------+-----------+--------+
| / | division | 4 / 2 | 2 |
+----------+---------------------+-----------+--------+
@@ -141,7 +140,6 @@
| >> | bitwise shift right | 8 >> 2 | 2 |
+----------+---------------------+-----------+--------+
- +, -, *, /
Notice integer division truncates results depending on the backend behaviour. For
instance, postgresql does.
--- a/web/test/unittest_facet.py Tue Oct 25 18:59:15 2011 +0200
+++ b/web/test/unittest_facet.py Wed Oct 26 14:12:35 2011 +0200
@@ -4,17 +4,17 @@
class BaseFacetTC(CubicWebTC):
- def prepare_rqlst(self, rql='CWUser X', baserql='Any X WHERE X is CWUser',
- preparedrql='DISTINCT Any WHERE X is CWUser',
- mainvar='X'):
+ def prepare_rqlst(self, rql='CWUser X', mainvar='X',
+ expected_baserql='Any X WHERE X is CWUser',
+ expected_preparedrql='DISTINCT Any WHERE X is CWUser'):
req = self.request()
rset = self.execute(rql)
rqlst = rset.syntax_tree().copy()
filtered_variable, baserql = facet.init_facets(rset, rqlst.children[0],
mainvar=mainvar)
self.assertEqual(filtered_variable.name, mainvar)
- self.assertEqual(baserql, baserql)
- self.assertEqual(rqlst.as_string(), preparedrql)
+ self.assertEqual(baserql, expected_baserql)
+ self.assertEqual(rqlst.as_string(), expected_preparedrql)
return req, rset, rqlst, filtered_variable
def _in_group_facet(self, cls=facet.RelationFacet, no_relation=False):
@@ -262,11 +262,11 @@
return self.prepare_rqlst(
'Any 1, COUNT(X) WHERE X is CWUser, X creation_date XD, '
'X modification_date XM, Y creation_date YD, Y is CWGroup '
- 'HAVING DAY(XD)>=DAY(YD) AND DAY(XM)<=DAY(YD)', mainvar='X',
- baserql='DISTINCT Any WHERE X is CWUser, X creation_date XD, '
+ 'HAVING DAY(XD)>=DAY(YD) AND DAY(XM)<=DAY(YD)', 'X',
+ expected_baserql='Any 1,COUNT(X) WHERE X is CWUser, X creation_date XD, '
'X modification_date XM, Y creation_date YD, Y is CWGroup '
'HAVING DAY(XD) >= DAY(YD), DAY(XM) <= DAY(YD)',
- preparedrql='DISTINCT Any WHERE X is CWUser, X creation_date XD, '
+ expected_preparedrql='DISTINCT Any WHERE X is CWUser, X creation_date XD, '
'X modification_date XM, Y creation_date YD, Y is CWGroup '
'HAVING DAY(XD) >= DAY(YD), DAY(XM) <= DAY(YD)')
--- a/web/wdoc/tut_rql_en.rst Tue Oct 25 18:59:15 2011 +0200
+++ b/web/wdoc/tut_rql_en.rst Wed Oct 26 14:12:35 2011 +0200
@@ -23,7 +23,7 @@
.. _here: schema
-Some bits of théory
+Some bits of theory
-------------------
Variables et types