Merge with 3.22
authorDenis Laxalde <denis.laxalde@logilab.fr>
Thu, 23 Jun 2016 15:52:04 +0200
changeset 11374 0e50215016f3
parent 11370 ec858780b6b7 (current diff)
parent 11373 68f0678fc543 (diff)
child 11375 fc8728791fbe
Merge with 3.22
cubicweb.spec
cubicweb/__pkginfo__.py
cubicweb/server/session.py
cubicweb/web/request.py
cubicweb/web/views/autoform.py
cubicweb/web/views/basetemplates.py
--- a/.hgtags	Thu Jun 23 08:53:21 2016 +0200
+++ b/.hgtags	Thu Jun 23 15:52:04 2016 +0200
@@ -520,6 +520,9 @@
 f66a4895759e0913b1203943fc2cd7be1a821e05 3.20.14
 f66a4895759e0913b1203943fc2cd7be1a821e05 debian/3.20.14-1
 f66a4895759e0913b1203943fc2cd7be1a821e05 centos/3.20.14-1
+636a83e65870433c2560f3c49d55ca628bc96e11 3.20.15
+636a83e65870433c2560f3c49d55ca628bc96e11 debian/3.20.15-1
+636a83e65870433c2560f3c49d55ca628bc96e11 centos/3.20.15-1
 887c6eef807781560adcd4ecd2dea9011f5a6681 3.21.0
 887c6eef807781560adcd4ecd2dea9011f5a6681 debian/3.21.0-1
 887c6eef807781560adcd4ecd2dea9011f5a6681 centos/3.21.0-1
--- a/cubicweb/server/session.py	Thu Jun 23 08:53:21 2016 +0200
+++ b/cubicweb/server/session.py	Thu Jun 23 15:52:04 2016 +0200
@@ -1117,7 +1117,7 @@
     # CWUser compat for notification ###########################################
 
     def name(self):
-        return 'cubicweb'
+        return ''
 
     class _IEmailable:
         @staticmethod
--- a/cubicweb/web/request.py	Thu Jun 23 08:53:21 2016 +0200
+++ b/cubicweb/web/request.py	Thu Jun 23 15:52:04 2016 +0200
@@ -884,9 +884,15 @@
             self.session.data.pop(self.pageid, None)
         else:
             try:
-                del self.session.data[self.pageid][key]
+                page_data = self.session.data[self.pageid]
+                del page_data[key]
             except KeyError:
                 pass
+            else:
+                # make sure we write the session data value in the
+                # self.session.data dict-like object so any session
+                # handler can "detect" and manage the persistency
+                self.session.data[self.pageid] = page_data
 
     # user-agent detection ####################################################
 
--- a/cubicweb/web/views/autoform.py	Thu Jun 23 08:53:21 2016 +0200
+++ b/cubicweb/web/views/autoform.py	Thu Jun 23 15:52:04 2016 +0200
@@ -484,13 +484,19 @@
 
 def _add_pending(req, eidfrom, rel, eidto, kind):
     key = 'pending_%s' % kind
-    pendings = req.session.data.setdefault(key, set())
-    pendings.add( (int(eidfrom), rel, int(eidto)) )
+    pendings = req.session.data.get(key, [])
+    value = (int(eidfrom), rel, int(eidto))
+    if value not in pendings:
+        pendings.append(value)
+        req.session.data[key] = pendings
 
 def _remove_pending(req, eidfrom, rel, eidto, kind):
     key = 'pending_%s' % kind
     pendings = req.session.data[key]
-    pendings.remove( (int(eidfrom), rel, int(eidto)) )
+    value = (int(eidfrom), rel, int(eidto))
+    if value in pendings:
+        pendings.remove(value)
+        req.session.data[key] = pendings
 
 @ajaxfunc(output_type='json')
 def remove_pending_insert(self, args):
--- a/cubicweb/web/views/basetemplates.py	Thu Jun 23 08:53:21 2016 +0200
+++ b/cubicweb/web/views/basetemplates.py	Thu Jun 23 15:52:04 2016 +0200
@@ -510,7 +510,8 @@
                 stitle = u'&#160;'
             w(u'<div class="loginTitle">%s</div>' % stitle)
         w(u'<div class="loginContent">\n')
-        message = self._cw.message  # don't call self._cw.message twice
+        # don't call self._cw.message twice since it pops the id
+        message = self._cw.message
         if showmessage and message:
             w(u'<div class="loginMessage">%s</div>\n' % message)
         config = self._cw.vreg.config
--- a/debian/changelog	Thu Jun 23 08:53:21 2016 +0200
+++ b/debian/changelog	Thu Jun 23 15:52:04 2016 +0200
@@ -70,6 +70,12 @@
 
  -- Julien Cristau <julien.cristau@logilab.fr>  Fri, 10 Jul 2015 17:04:11 +0200
 
+cubicweb (3.20.15-1) unstable; urgency=medium
+
+  * new upstream release 
+
+ -- David Douard <david.douard@logilab.fr>  Mon, 09 May 2016 17:04:10 +0200
+
 cubicweb (3.20.14-1) unstable; urgency=medium
 
   * new upstream release
--- a/doc/announce.en.txt	Thu Jun 23 08:53:21 2016 +0200
+++ b/doc/announce.en.txt	Thu Jun 23 15:52:04 2016 +0200
@@ -33,10 +33,10 @@
 The impatient will move right away to installation_ and set-up of a CubicWeb
 environment.
 
-.. _cubicweb: http://www.cubicweb.org/
-.. _overview: http://www.cubicweb.org/doc/en/A020-tutorial.en.html#overview
-.. _forge: http://www.cubicweb.org/project?vtitle=All%20cubicweb%20projects
-.. _installation: http://www.cubicweb.org/doc/en/C010-setup.en.html#miseenplaceenv
+.. _cubicweb: https://www.cubicweb.org/
+.. _overview: https://docs.cubicweb.org/tutorials/base/index.html
+.. _forge: https://www.cubicweb.org/project?vtitle=All%20cubicweb%20projects
+.. _installation: https://docs.cubicweb.org/book/admin/setup.html#setupenv
 
 Home page
 ---------
--- a/doc/book/admin/config.rst	Thu Jun 23 08:53:21 2016 +0200
+++ b/doc/book/admin/config.rst	Thu Jun 23 15:52:04 2016 +0200
@@ -8,7 +8,6 @@
 You can `configure the database`_ system of your choice:
 
   - `PostgreSQL configuration`_
-  - `MySql configuration`_
   - `SQLServer configuration`_
   - `SQLite configuration`_
 
@@ -18,7 +17,6 @@
 
 .. _`configure the database`: DatabaseInstallation_
 .. _`PostgreSQL configuration`: PostgresqlConfiguration_
-.. _`MySql configuration`: MySqlConfiguration_
 .. _`SQLServer configuration`: SQLServerConfiguration_
 .. _`SQLite configuration`: SQLiteConfiguration_
 .. _`Cubicweb resources configuration`: RessourcesConfiguration_
@@ -41,7 +39,7 @@
 Each instance can be configured with its own database connection information,
 that will be stored in the instance's :file:`sources` file. The database to use
 will be chosen when creating the instance. CubicWeb is known to run with
-Postgresql (recommended), SQLServer and SQLite, and may run with MySQL.
+Postgresql (recommended), SQLServer and SQLite.
 
 Other possible sources of data include CubicWeb, Subversion, LDAP and Mercurial,
 but at least one relational database is required for CubicWeb to work. You do
@@ -89,6 +87,10 @@
 
     $ initdb -E UTF8 -D /path/to/pgsql
 
+Note: ``initdb`` might not be in the PATH, so you may have to use its
+absolute path instead (usually something like
+``/usr/lib/postgresql/9.4/bin/initdb``).
+
 Notice the encoding specification. This is necessary since |cubicweb| usually
 want UTF8 encoded database. If you use a cluster with the wrong encoding, you'll
 get error like::
@@ -105,6 +107,7 @@
 
   $ chown username /path/to/pgsql
 
+
 Database authentication
 +++++++++++++++++++++++
 
@@ -116,31 +119,42 @@
 
   $ su
   $ su - postgres
-  $ createuser -s -P username
+  $ createuser -s -P <dbuser>
 
 The option `-P` (for password prompt), will encrypt the password with the
 method set in the configuration file :file:`pg_hba.conf`.  If you do not use this
 option `-P`, then the default value will be null and you will need to set it
 with::
 
-  $ su postgres -c "echo ALTER USER username WITH PASSWORD 'userpasswd' | psql"
+  $ su postgres -c "echo ALTER USER <dbuser> WITH PASSWORD '<dbpassword>' | psql"
 
 The above login/password will be requested when you will create an instance with
 `cubicweb-ctl create` to initialize the database of your instance.
 
+
+Database creation
++++++++++++++++++
+
+If you create the database by hand (instead of using the `cubicweb-ctl
+db-create` tool), you may want to make sure that the local settings are
+properly set. For example, if you need to handle french accents
+properly for indexing and sorting, you may need to create the database
+with something like::
+
+  $ createdb --encoding=UTF-8 --locale=fr_FR.UTF-8 -t template0 -O <owner> <dbname>
+
 Notice that the `cubicweb-ctl db-create` does database initialization that
 may requires a postgres superuser. That's why a login/password is explicitly asked
 at this step, so you can use there a superuser without using this user when running
 the instance. Things that require special privileges at this step:
 
 * database creation, require the 'create database' permission
-* install the plpython extension language (require superuser)
-* install the tsearch extension for postgres version prior to 8.3 (require superuser)
+* install the `plpython` extension language (require superuser)
 
 To avoid using a super user each time you create an install, a nice trick is to
 install plpython (and tsearch when needed) on the special `template1` database,
 so they will be installed automatically when cubicweb databases are created
-without even with needs for special access rights. To do so, run ::
+without needs for special access rights. To do so, run ::
 
   # Installation of plpythonu language by default ::
   $ createlang -U pgadmin plpythonu template1
@@ -151,29 +165,6 @@
 default plpython is an 'untrusted' language and as such can't be used by non
 superuser. This update fix that problem by making it trusted.
 
-To install the tsearch plain-text index extension on postgres prior to 8.3, run::
-
-    cat /usr/share/postgresql/8.X/contrib/tsearch2.sql | psql -U username template1
-
-
-.. _MySqlConfiguration:
-
-MySql
-~~~~~
-.. warning::
-    CubicWeb's MySQL support is not commonly used, so things may or may not work properly.
-
-You must add the following lines in ``/etc/mysql/my.cnf`` file::
-
-    transaction-isolation=READ-COMMITTED
-    default-storage-engine=INNODB
-    default-character-set=utf8
-    max_allowed_packet = 128M
-
-.. Note::
-    It is unclear whether mysql supports indexed string of arbitrary length or
-    not.
-
 
 .. _SQLServerConfiguration:
 
@@ -226,4 +217,3 @@
 .. Note::
   SQLite is great for testing and to play with cubicweb but is not suited for
   production environments.
-
--- a/doc/book/devweb/internationalization.rst	Thu Jun 23 08:53:21 2016 +0200
+++ b/doc/book/devweb/internationalization.rst	Thu Jun 23 15:52:04 2016 +0200
@@ -227,3 +227,29 @@
 
 It is also possible to explicitly use the with _cw.pgettext(context,
 msgid).
+
+
+Specialize translation for an application cube
+``````````````````````````````````````````````
+
+Every cube has its own translation files. For a specific application cube
+it can be useful to specialize translations of other cubes. You can either mark
+those strings for translation using `_` in the python code, or add a
+`static-messages.pot` file into the `i18n` directory. This file
+looks like: ::
+
+    msgid ""
+    msgstr ""
+    "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
+    "MIME-Version: 1.0\n"
+    "Content-Type: text/plain; charset=UTF-8\n"
+    "Content-Transfer-Encoding: 8bit\n"
+    "Generated-By: pygettext.py 1.5\n"
+    "Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+    msgig "expression to be translated"
+    msgstr ""
+
+Doing this, ``expression to be translated`` will be taken into account by
+the ``i18ncube`` command and additional messages will then appear in `.po` files
+of the cube.