backport stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 22 Jan 2010 14:41:08 +0100
changeset 4335 1314772c1183
parent 4334 dda74c345b06 (current diff)
parent 4331 659ca14ab356 (diff)
child 4336 45e5b8bd2f71
backport stable
rqlrewrite.py
utils.py
web/views/baseviews.py
web/views/navigation.py
--- a/doc/book/en/annexes/depends.rst	Fri Jan 22 14:40:29 2010 +0100
+++ b/doc/book/en/annexes/depends.rst	Fri Jan 22 14:41:08 2010 +0100
@@ -42,26 +42,31 @@
 * indexer - http://www.logilab.org/project/indexer -
   http://pypi.python.org/pypi/indexer - included in the forest
 
-To activate Sparql querying:
-
-* fyzz - http://www.logilab.org/project/fyzz - http://pypi.python.org/pypi/fyzz
-  - included in the forest
-
 To use network communication between cubicweb instances / clients:
 
 * Pyro - http://pyro.sourceforge.net/ - http://pypi.python.org/pypi/Pyro
 
 If you're using a Postgres database (recommended):
+
 * psycopg2 - http://initd.org/projects/psycopg2 - http://pypi.python.org/pypi/psycopg2
+* plpythonu extension
+* tsearch2 extension (for postgres < 8.3, in postgres-contrib)
+
+Other optional packages :
+
+:
+
+* fyzz - http://www.logilab.org/project/fyzz -
+  http://pypi.python.org/pypi/fyzz - included in the forest, *to activate Sparql querying*
 
 For the google-appengine extension to be available, you also need:
 
-* dateutil - http://labix.org/python-dateutil -
-  http://pypi.python.org/pypi/python-dateutil/
+* vobject - http://vobject.skyhouseconsulting.com/ -
+  http://pypi.python.org/pypi/vobject, *for the icalendar view*. For those not
+  benefiting from a packaging system, note that vobject itself depends on
+  dateutil - http://labix.org/python-dateutil -
+  http://pypi.python.org/pypi/python-dateutil/.
 
-* vobject - http://vobject.skyhouseconsulting.com/ -
-  http://pypi.python.org/pypi/vobject
 
-  
 Any help with the packaging of CubicWeb for more than Debian/Ubuntu (including
 eggs, buildouts, etc) will be greatly appreciated.
--- a/rqlrewrite.py	Fri Jan 22 14:40:29 2010 +0100
+++ b/rqlrewrite.py	Fri Jan 22 14:41:08 2010 +0100
@@ -327,7 +327,7 @@
             self.compute_solutions()
         except Unsupported:
             # some solutions have been lost, can't apply this rql expr
-            self.select.remove_subquery(new, undefine=True)
+            self.select.remove_subquery(self.select.with_[-1])
             raise
         return subselect
 
--- a/utils.py	Fri Jan 22 14:40:29 2010 +0100
+++ b/utils.py	Fri Jan 22 14:41:08 2010 +0100
@@ -152,6 +152,9 @@
 # use networkX instead ?
 # http://networkx.lanl.gov/reference/algorithms.traversal.html#module-networkx.algorithms.traversal.astar
 def transitive_closure_of(entity, relname, _seen=None):
+    """return transitive closure *for the subgraph starting from the given
+    entity* (eg 'parent' entities are not included in the results)
+    """
     if _seen is None:
         _seen = set()
     _seen.add(entity.eid)
--- a/web/views/baseviews.py	Fri Jan 22 14:40:29 2010 +0100
+++ b/web/views/baseviews.py	Fri Jan 22 14:41:08 2010 +0100
@@ -72,13 +72,16 @@
         etype = self.cw_rset.description[row][col]
         value = self.cw_rset.rows[row][col]
 
+        if value is None:
+            self.w(u'')
+            return
         if etype == 'String':
             entity, rtype = self.cw_rset.related_entity(row, col)
             if entity is not None:
                 # yes !
                 self.w(entity.printable_value(rtype, value, format=format))
                 return
-        if etype in ('Time', 'Interval'):
+        elif etype in ('Time', 'Interval'):
             if etype == 'Interval' and isinstance(value, (int, long)):
                 # `date - date`, unlike `datetime - datetime` gives an int
                 # (number of days), not a timedelta
--- a/web/views/navigation.py	Fri Jan 22 14:40:29 2010 +0100
+++ b/web/views/navigation.py	Fri Jan 22 14:41:08 2010 +0100
@@ -222,7 +222,7 @@
     """paginate results if the view is paginable and we're not explictly told to
     display everything (by setting __force_display in req.form)
     """
-    if not (view.paginable or view._cw.form.get('__force_display')):
+    if view.paginable ant not view._cw.form.get('__force_display'):
         do_paginate(view, rset, w or view.w, show_all_option, page_size)
 
 # monkey patch base View class to add a .paginate([...])