--- a/cwctl.py Wed Jul 29 10:44:36 2009 +0200
+++ b/cwctl.py Wed Jul 29 10:44:55 2009 +0200
@@ -353,7 +353,7 @@
if ex.errno != errno.ENOENT:
raise
confignames = ', '.join([config.name for config in configs])
- print 'instance %s (%s) deleted' % (appid, confignames)
+ print '-> instance %s (%s) deleted.' % (appid, confignames)
# instance commands ########################################################
@@ -407,7 +407,7 @@
print
return False
if not debug:
- print 'instance %s started' % appid
+ print '-> instance %s started.' % appid
return True
@@ -656,8 +656,7 @@
print '-> no software migration needed for instance %s.' % appid
return
for cube, fromversion, toversion in toupgrade:
- print '\n' + underline_title('%s migration %s -> %s' %
- (cube, fromversion, toversion))
+ print '-> migration needed from %s to %s for %s' % (fromversion, toversion, cube)
# only stop once we're sure we have something to do
if not (cwcfg.mode == 'dev' or self.config.nostartstop):
self.stop_instance(appid)
--- a/devtools/devctl.py Wed Jul 29 10:44:36 2009 +0200
+++ b/devtools/devctl.py Wed Jul 29 10:44:55 2009 +0200
@@ -12,7 +12,7 @@
from datetime import datetime
from os import mkdir, chdir
from os.path import join, exists, abspath, basename, normpath, split, isdir
-
+from warnings import warn
from logilab.common import STD_BLACKLIST
from logilab.common.modutils import get_module_files
@@ -260,7 +260,7 @@
from logilab.common.shellutils import globfind, find, rm
from cubicweb.common.i18n import extract_from_tal, execute
tempdir = tempdir.mkdtemp()
- potfiles = [join(I18NDIR, 'entities.pot')]
+ potfiles = [join(I18NDIR, 'static-messages.pot')]
print '-> extract schema messages.'
schemapot = join(tempdir, 'schema.pot')
potfiles.append(schemapot)
@@ -357,8 +357,14 @@
tempdir = tempfile.mkdtemp()
print underline_title('Updating i18n catalogs for cube %s' % cube)
chdir(cubedir)
- potfiles = [join('i18n', scfile) for scfile in ('entities.pot',)
- if exists(join('i18n', scfile))]
+ if exists(join('i18n', 'entities.pot')):
+ warn('entities.pot is deprecated, rename file to static-messages.pot (%s)'
+ % join('i18n', 'entities.pot'), DeprecationWarning)
+ potfiles = [join('i18n', 'entities.pot')]
+ elif exists(join('i18n', 'static-messages.pot')):
+ potfiles = [join('i18n', 'static-messages.pot')]
+ else:
+ potfiles = []
print '-> extract schema messages'
schemapot = join(tempdir, 'schema.pot')
potfiles.append(schemapot)
--- a/doc/book/en/.templates/layout.html Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/.templates/layout.html Wed Jul 29 10:44:55 2009 +0200
@@ -4,7 +4,7 @@
{%- endblock %}
{%- set reldelim1 = reldelim1 is not defined and ' »' or reldelim1 %}
{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %}
-{%- macro relbar %}
+{%- macro relbar() %}
<div class="related">
<h3>Navigation</h3>
<ul>
@@ -24,7 +24,7 @@
</ul>
</div>
{%- endmacro %}
-{%- macro sidebar %}
+{%- macro sidebar() %}
{%- if builder != 'htmlhelp' %}
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
--- a/doc/book/en/Z012-create-instance.en.txt Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/Z012-create-instance.en.txt Wed Jul 29 10:44:55 2009 +0200
@@ -52,7 +52,7 @@
sufficient. You can allways modify the parameters later by editing
configuration files. When a user/psswd is requested to access the database
please use the login you create at the time you configured the database
-(:ref:`ConfigurationPostgres`).
+(:ref:`ConfigurationPostgresql`).
It is important to distinguish here the user used to access the database and
the user used to login to the cubicweb instance. When a *CubicWeb* instance
--- a/doc/book/en/admin/create-instance.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/admin/create-instance.rst Wed Jul 29 10:44:55 2009 +0200
@@ -6,9 +6,8 @@
Instance creation
-----------------
-Now that we created our cube, we can create an instance to view our
-instance in a web browser. To do so we will use a `all-in-one`
-configuration to simplify things ::
+Now that we created a cube, we can create an instance and access it via a web
+browser. We will use a `all-in-one` configuration to simplify things ::
cubicweb-ctl create -c all-in-one mycube myinstance
@@ -21,7 +20,7 @@
sufficient. You can anyway modify the configuration later on by editing
configuration files. When a user/psswd is requested to access the database
please use the login you create at the time you configured the database
-(:ref:`ConfigurationPostgres`).
+(:ref:`ConfigurationPostgresql`).
It is important to distinguish here the user used to access the database and the
user used to login to the cubicweb instance. When an instance starts, it uses
@@ -60,5 +59,9 @@
upgrade
~~~~~~~
+The command is::
+
+ cubicweb-ctl upgrade myinstance
+
XXX write me
--- a/doc/book/en/admin/gae.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/admin/gae.rst Wed Jul 29 10:44:55 2009 +0200
@@ -1,5 +1,7 @@
.. -*- coding: utf-8 -*-
+.. _GoogleAppEngineSource:
+
CubicWeb in Google AppEngine
============================
@@ -26,7 +28,7 @@
Please follow instructions on how to install *CubicWeb* framework
-(:ref:`CubicWebInstallation`).
+(:ref:`SetUpEnv`).
Installation
------------
--- a/doc/book/en/admin/instance-config.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/admin/instance-config.rst Wed Jul 29 10:44:55 2009 +0200
@@ -10,7 +10,7 @@
For example::
- /etc/cubicweb.d/JPL/all-in-one.conf
+ /etc/cubicweb.d/myblog/all-in-one.conf
It is a simple text file format INI. In the following description,
each option name is prefixed with its own section and followed by its
--- a/doc/book/en/admin/multisources.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/admin/multisources.rst Wed Jul 29 10:44:55 2009 +0200
@@ -1,4 +1,6 @@
-Integrating some data from another instance
-===========================================
+Multiple sources of data
+========================
-XXX feed me
\ No newline at end of file
+Data sources include SQL, LDAP, RQL, mercurial and subversion.
+
+XXX feed me
--- a/doc/book/en/admin/setup.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/admin/setup.rst Wed Jul 29 10:44:55 2009 +0200
@@ -77,18 +77,21 @@
In both cases, make sure you have installed the dependencies (see appendixes for
the list).
-Postgres installation
-`````````````````````
+PostgreSQL installation
+```````````````````````
-Please refer to the `Postgresql project online documentation`_.
+Please refer to the `PostgreSQL project online documentation`_.
-.. _`Postgresql project online documentation`: http://www.postgresql.org/
+.. _`PostgreSQL project online documentation`: http://www.postgresql.org/
-You need to install the three following packages: `postgres-8.3`,
-`postgres-contrib-8.3` and `postgresql-plpython-8.3`.
+You need to install the three following packages: `postgresql-8.3`,
+`postgresql-contrib-8.3` and `postgresql-plpython-8.3`.
-Then you can install:
+Other dependencies
+``````````````````
+
+You can also install:
* `pyro` if you wish the repository to be accessible through Pyro
or if the client and the server are not running on the same machine
@@ -134,22 +137,22 @@
-.. _ConfigurationPostgres:
+.. _ConfigurationPostgresql:
-Postgres configuration
-``````````````````````
+PostgreSQL configuration
+````````````````````````
.. note::
- If you already have an existing cluster and postgres server
+ If you already have an existing cluster and PostgreSQL server
running, you do not need to execute the initilization step
- of your Postgres database.
+ of your PostgreSQL database.
-* First, initialize the database Postgres with the command ``initdb``.
+* First, initialize the database PostgreSQL with the command ``initdb``.
::
$ initdb -D /path/to/pgsql
- Once initialized, start the database server Postgres
+ Once initialized, start the database server PostgreSQL
with the command::
$ postgres -D /path/to/psql
@@ -199,13 +202,17 @@
MySql configuration
```````````````````
-Yout must add the following lines in /etc/mysql/my.cnf file::
+Yout 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 lenght or
+ not.
+
Pyro configuration
------------------
--- a/doc/book/en/annexes/cookbook.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/annexes/cookbook.rst Wed Jul 29 10:44:55 2009 +0200
@@ -9,6 +9,8 @@
* How to import LDAP users in *CubicWeb*?
+ [XXX distribute this script with cubicweb instead]
+
Here is a very useful script which enables you to import LDAP users
into your *CubicWeb* instance by running the following: ::
--- a/doc/book/en/annexes/depends.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/annexes/depends.rst Wed Jul 29 10:44:55 2009 +0200
@@ -44,5 +44,8 @@
* indexer - http://www.logilab.org/project/indexer -
http://pypi.python.org/pypi/indexer - included in the forest
+* fyzz - http://www.logilab.org/project/fyzz - http://pypi.python.org/pypi/fyzz
+ - included in the forest
+
Any help with the packaging of CubicWeb for more than Debian/Ubuntu (including
eggs, buildouts, etc) will be greatly appreciated.
--- a/doc/book/en/annexes/faq.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/annexes/faq.rst Wed Jul 29 10:44:55 2009 +0200
@@ -14,80 +14,79 @@
Why does not CubicWeb have a template language ?
------------------------------------------------
- There are enough template languages out there. You can use your
- preferred template language if you want. [explain how to use a
- template language]
+There are enough template languages out there. You can use your
+preferred template language if you want. [explain how to use a
+template language]
- *CubicWeb* does not define its own templating language as this was
- not our goal. Based on our experience, we realized that
- we could gain productivity by letting designers use design tools
- and developpers develop without the use of the templating language
- as an intermediary that could not be anyway efficient for both parties.
- Python is the templating language that we use in *CubicWeb*, but again,
- it does not prevent you from using a templating language.
+*CubicWeb* does not define its own templating language as this was
+not our goal. Based on our experience, we realized that
+we could gain productivity by letting designers use design tools
+and developpers develop without the use of the templating language
+as an intermediary that could not be anyway efficient for both parties.
+Python is the templating language that we use in *CubicWeb*, but again,
+it does not prevent you from using a templating language.
- The reason template languages are not used in this book is that
- experience has proved us that using pure python was less cumbersome.
+The reason template languages are not used in this book is that
+experience has proved us that using pure python was less cumbersome.
Why do you think using pure python is better than using a template language ?
-----------------------------------------------------------------------------
- Python is an Object Oriented Programming language and as such it
- already provides a consistent and strong architecture and syntax
- a templating language would not reach.
+Python is an Object Oriented Programming language and as such it
+already provides a consistent and strong architecture and syntax
+a templating language would not reach.
- When doing development, you need a real language and template
- languages are not real languages.
+When doing development, you need a real language and template
+languages are not real languages.
- Using Python enables developing applications for which code is
- easier to maintain with real functions/classes/contexts
- without the need of learning a new dialect. By using Python,
- we use standard OOP techniques and this is a key factor in a
- robust application.
+Using Python instead of a template langage for describing the user interface
+makes it to maintain with real functions/classes/contexts without the need of
+learning a new dialect. By using Python, we use standard OOP techniques and
+this is a key factor in a robust application.
Why do you use the LGPL license to prevent me from doing X ?
------------------------------------------------------------
- LGPL means that *if* you redistribute your application, you need to
- redistribute the changes you made to CubicWeb under the LGPL licence.
+LGPL means that *if* you redistribute your application, you need to
+redistribute the changes you made to CubicWeb under the LGPL licence.
- Publishing a web site has nothing to do with redistributing
- source code. A fair amount of companies use modified LGPL code
- for internal use. And someone could publish a *CubicWeb* component
- under a BSD licence for others to plug into a LGPL framework without
- any problem. The only thing we are trying to prevent here is someone
- taking the framework and packaging it as closed source to his own
- clients.
+Publishing a web site has nothing to do with redistributing
+source code. A fair amount of companies use modified LGPL code
+for internal use. And someone could publish a *CubicWeb* component
+under a BSD licence for others to plug into a LGPL framework without
+any problem. The only thing we are trying to prevent here is someone
+taking the framework and packaging it as closed source to his own
+clients.
CubicWeb looks pretty recent. Is it stable ?
--------------------------------------------
- It is constantly evolving, piece by piece. The framework has evolved since
- 2001 and data has been migrated from one schema to the other ever since. There
- is a well-defined way to handle data and schema migration.
+It is constantly evolving, piece by piece. The framework has evolved since
+2001 and data has been migrated from one schema to the other ever since. There
+is a well-defined way to handle data and schema migration.
Why is the RQL query language looking similar to X ?
-----------------------------------------------------
- It may remind you of SQL but it is higher level than SQL, more like
- SPARQL. Except that SPARQL did not exist when we started the project.
- Having SPARQL as a query language has been in our backlog for years.
+It may remind you of SQL but it is higher level than SQL, more like
+SPARQL. Except that SPARQL did not exist when we started the project.
+With version 3.4, CubicWeb has support for SPARQL.
- That RQL language is what is going to make a difference with django-
- like frameworks for several reasons.
+That RQL language is what is going to make a difference with django-
+like frameworks for several reasons.
- 1. accessing data is *much* easier with it. One can write complex
- queries with RQL that would be tedious to define and hard to maintain
- using an object/filter suite of method calls.
+1. accessing data is *much* easier with it. One can write complex
+ queries with RQL that would be tedious to define and hard to maintain
+ using an object/filter suite of method calls.
- 2. it offers an abstraction layer allowing your applications to run
- on multiple back-ends. That means not only various SQL backends
- (postgresql, sqlite, mysql), but also multiple databases at the
- same time, and also non-SQL data stores like LDAP directories and
- subversion/mercurial repositories (see the `vcsfile`
- component). Google App Engine is yet another supported target for
- RQL.
+2. it offers an abstraction layer allowing your applications to run
+ on multiple back-ends. That means not only various SQL backends
+ (postgresql, sqlite, mysql), but also multiple databases at the
+ same time, and also non-SQL data stores like LDAP directories and
+ subversion/mercurial repositories (see the `vcsfile`
+ component). Google App Engine is yet another supported target for
+ RQL.
[copy answer from forum, explain why similar to sparql and why better
than django and SQL]
@@ -101,7 +100,9 @@
How is security implemented ?
------------------------------
- This is an example of how it works in our framework::
+This is an example of how it works in our framework:
+
+.. sourcecode:: python
class Version(EntityType):
"""a version is defining the content of a particular project's
@@ -111,16 +112,17 @@
'update': ('managers', 'logilab', 'owners',),
'delete': ('managers', ),
'add': ('managers', 'logilab',
- ERQLExpression('X version_of PROJ, U in_group G, '
- 'PROJ require_permission P, '
- 'P name "add_version", P require_group G'),)}
+ ERQLExpression('X version_of PROJ, U in_group G, '
+ 'PROJ require_permission P, '
+ 'P name "add_version", P require_group G'),)}
- The above means that permission to read a Version is granted to any
- user that is part of one of the groups 'managers', 'users', 'guests'.
- The 'add' permission is granted to users in group 'managers' or
- 'logilab' and to users in group G, if G is linked by a permission
- entity named "add_version" to the version's project.
- ::
+The above means that permission to read a Version is granted to any
+user that is part of one of the groups 'managers', 'users', 'guests'.
+The 'add' permission is granted to users in group 'managers' or
+'logilab' and to users in group G, if G is linked by a permission
+entity named "add_version" to the version's project.
+
+.. sourcecode:: python
class version_of(RelationType):
"""link a version to its project. A version is necessarily linked
@@ -129,20 +131,20 @@
permissions = {'read': ('managers', 'users', 'guests',),
'delete': ('managers', ),
'add': ('managers', 'logilab',
- RRQLExpression('O require_permission P, P name "add_version",
- 'U in_group G, P require_group G'),) }
+ RRQLExpression('O require_permission P, P name "add_version", '
+ 'U in_group G, P require_group G'),) }
- You can find additional information in the section :ref:`security`.
+You can find additional information in the section :ref:`security`.
- [XXX what does the second example means in addition to the first one?]
+[XXX what does the second example means in addition to the first one?]
What is `Error while publishing rest text ...` ?
------------------------------------------------
- While modifying the description of an entity, you get an error message in
- the instance `Error while publishing ...` for Rest text and plain text.
- The server returns a traceback like as follows ::
+While modifying the description of an entity, you get an error message in
+the instance `Error while publishing ...` for Rest text and plain text.
+The server returns a traceback like as follows ::
2008-10-06 15:05:08 - (cubicweb.rest) ERROR: error while publishing ReST text
Traceback (most recent call last):
@@ -151,73 +153,69 @@
file = __builtin__.open(filename, mode, buffering)
TypeError: __init__() takes at most 3 arguments (4 given)
-
- This can be fixed by applying the patch described in :
- http://code.google.com/p/googleappengine/issues/detail?id=48
+This can be fixed by applying the patch described in :
+http://code.google.com/p/googleappengine/issues/detail?id=48
What are hooks used for ?
-------------------------
- Hooks are executed around (actually before or after) events. The
- most common events are data creation, update and deletion. They
- permit additional constraint checking (those not expressible at the
- schema level), pre and post computations depending on data
- movements.
+Hooks are executed around (actually before or after) events. The
+most common events are data creation, update and deletion. They
+permit additional constraint checking (those not expressible at the
+schema level), pre and post computations depending on data
+movements.
- As such, they are a vital part of the framework.
+As such, they are a vital part of the framework.
- Other kinds of hooks, called Operations, are available
- for execution just before commit.
+Other kinds of hooks, called Operations, are available
+for execution just before commit.
When should you define an HTML template rather than define a graphical component ?
----------------------------------------------------------------------------------
- An HTML template cannot contain code, hence it is only about static
- content. A component is made of code and operations that apply on a
- well defined context (request, result set). It enables much more
- dynamic views.
+An HTML template cannot contain code, hence it is only about static
+content. A component is made of code and operations that apply on a
+well defined context (request, result set). It enables much more
+dynamic views.
What is the difference between `AppRsetObject` and `AppObject` ?
----------------------------------------------------------------
- `AppRsetObject` instances are selected on a request and a result
- set. `AppObject` instances are directly selected by id.
+`AppRsetObject` instances are selected on a request and a result
+set. `AppObject` instances are directly selected by id.
How to update a database after a schema modification ?
------------------------------------------------------
- It depends on what has been modified in the schema.
-
- * Update of an attribute permissions and properties:
- ``synchronize_eschema('MyEntity')``.
+It depends on what has been modified in the schema.
- * Update of a relation permissions and properties:
- ``synchronize_rschema('MyRelation')``.
+* Update the permissions and properties of an entity or a relation:
+ ``sync_schema_props_perms('MyEntityOrRelation')``.
- * Add an attribute: ``add_attribute('MyEntityType', 'myattr')``.
+* Add an attribute: ``add_attribute('MyEntityType', 'myattr')``.
- * Add a relation: ``add_relation_definition('SubjRelation', 'MyRelation', 'ObjRelation')``.
+* Add a relation: ``add_relation_definition('SubjRelation', 'MyRelation', 'ObjRelation')``.
How to create an anonymous user ?
---------------------------------
- This allows to bypass authentication for your site. In the
- ``all-in-one.conf`` file of your instance, define the anonymous user
- as follows ::
+This allows to bypass authentication for your site. In the
+``all-in-one.conf`` file of your instance, define the anonymous user
+as follows ::
- # login of the CubicWeb user account to use for anonymous user (if you want to
- # allow anonymous)
- anonymous-user=anon
+ # login of the CubicWeb user account to use for anonymous user (if you want to
+ # allow anonymous)
+ anonymous-user=anon
- # password of the CubicWeb user account matching login
- anonymous-password=anon
+ # password of the CubicWeb user account matching login
+ anonymous-password=anon
- You also must ensure that this `anon` user is a registered user of
- the DB backend. If not, you can create through the administation
- interface of your instance by adding a user with the role `guests`.
- This could be the admin account (for development
- purposes, of course).
+You also must ensure that this `anon` user is a registered user of
+the DB backend. If not, you can create through the administation
+interface of your instance by adding a user with the role `guests`.
+This could be the admin account (for development
+purposes, of course).
.. note::
While creating a new instance, you can decide to allow access
@@ -228,55 +226,57 @@
How to change the instance logo ?
------------------------------------
- There are two ways of changing the logo.
+There are two ways of changing the logo.
- 1. The easiest way to use a different logo is to replace the existing
- ``logo.png`` in ``myapp/data`` by your prefered icon and refresh.
- By default all instance will look for a ``logo.png`` to be
- rendered in the logo section.
+1. The easiest way to use a different logo is to replace the existing
+ ``logo.png`` in ``myapp/data`` by your prefered icon and refresh.
+ By default all instance will look for a ``logo.png`` to be
+ rendered in the logo section.
- .. image:: ../images/lax-book.06-main-template-logo.en.png
+ .. image:: ../images/lax-book.06-main-template-logo.en.png
- 2. In your cube directory, you can specify which file to use for the logo.
- This is configurable in ``mycube/data/external_resources``: ::
+2. In your cube directory, you can specify which file to use for the logo.
+ This is configurable in ``mycube/data/external_resources``: ::
- LOGO = DATADIR/path/to/mylogo.gif
+ LOGO = DATADIR/path/to/mylogo.gif
- where DATADIR is ``mycube/data``.
+ where DATADIR is ``mycube/data``.
How to configure a LDAP source ?
--------------------------------
- Your instance's sources are defined in ``/etc/cubicweb.d/myapp/sources``.
- Configuring an LDAP source is about declaring that source in your
- instance configuration file such as: ::
+Your instance's sources are defined in ``/etc/cubicweb.d/myapp/sources``.
+Configuring an LDAP source is about declaring that source in your
+instance configuration file such as: ::
- [ldapuser]
- adapter=ldapuser
- # ldap host
- host=myhost
- # base DN to lookup for usres
- user-base-dn=ou=People,dc=mydomain,dc=fr
- # user search scope
- user-scope=ONELEVEL
- # classes of user
- user-classes=top,posixAccount
- # attribute used as login on authentication
- user-login-attr=uid
- # name of a group in which ldap users will be by default
- user-default-group=users
- # map from ldap user attributes to cubicweb attributes
- user-attrs-map=gecos:email,uid:login
+ [ldapuser]
+ adapter=ldapuser
+ # ldap host
+ host=myhost
+ # base DN to lookup for usres
+ user-base-dn=ou=People,dc=mydomain,dc=fr
+ # user search scope
+ user-scope=ONELEVEL
+ # classes of user
+ user-classes=top,posixAccount
+ # attribute used as login on authentication
+ user-login-attr=uid
+ # name of a group in which ldap users will be by default
+ user-default-group=users
+ # map from ldap user attributes to cubicweb attributes
+ user-attrs-map=gecos:email,uid:login
- Any change applied to configuration file requires to restart your
- instance.
+Any change applied to configuration file requires to restart your
+instance.
I get NoSelectableObject exceptions, how do I debug selectors ?
---------------------------------------------------------------
- You just need to put the appropriate context manager around view/component
- selection (one standard place in in vreg.py) : ::
+You just need to put the appropriate context manager around view/component
+selection (one standard place in in vreg.py):
+
+.. sourcecode:: python
def possible_objects(self, registry, *args, **kwargs):
"""return an iterator on possible objects in a registry for this result set
@@ -291,40 +291,43 @@
except NoSelectableObject:
continue
- Don't forget the 'from __future__ improt with_statement' at the
- module top-level.
+Don't forget the 'from __future__ import with_statement' at the module
+top-level.
- This will yield additional WARNINGs, like this:
- ::
+This will yield additional WARNINGs, like this::
2009-01-09 16:43:52 - (cubicweb.selectors) WARNING: selector one_line_rset returned 0 for <class 'cubicweb.web.views.basecomponents.WFHistoryVComponent'>
How to format an entity date attribute ?
----------------------------------------
- If your schema has an attribute of type Date or Datetime, you might
- want to format it. First, you should define your preferred format using
- the site configuration panel ``http://appurl/view?vid=systempropertiesform``
- and then set ``ui.date`` and/or ``ui.datetime``.
- Then in the view code, use::
+If your schema has an attribute of type Date or Datetime, you might
+want to format it. First, you should define your preferred format using
+the site configuration panel ``http://appurl/view?vid=systempropertiesform``
+and then set ``ui.date`` and/or ``ui.datetime``.
+Then in the view code, use:
+
+.. sourcecode:: python
self.format_date(entity.date_attribute)
Can PostgreSQL and CubicWeb authentication work with kerberos ?
----------------------------------------------------------------
- If you have PostgreSQL set up to accept kerberos authentication, you can set
- the db-host, db-name and db-user parameters in the `sources` configuration
- file while leaving the password blank. It should be enough for your
- instance to connect to postgresql with a kerberos ticket.
+If you have PostgreSQL set up to accept kerberos authentication, you can set
+the db-host, db-name and db-user parameters in the `sources` configuration
+file while leaving the password blank. It should be enough for your
+instance to connect to postgresql with a kerberos ticket.
How to load data from a script ?
--------------------------------
- The following script aims at loading data within a script assuming pyro-nsd is
- running and your instance is configured with ``pyro-server=yes``, otherwise
- you would not be able to use dbapi. ::
+The following script aims at loading data within a script assuming pyro-nsd is
+running and your instance is configured with ``pyro-server=yes``, otherwise
+you would not be able to use dbapi.
+
+.. sourcecode:: python
from cubicweb import dbapi
@@ -337,24 +340,30 @@
What is the CubicWeb datatype corresponding to GAE datastore's UserProperty ?
-----------------------------------------------------------------------------
- If you take a look at your instance schema and
- click on "display detailed view of metadata" you will see that there
- is a Euser entity in there. That's the one that is modeling users. The
- thing that corresponds to a UserProperty is a relationship between
- your entity and the Euser entity. As in ::
+If you take a look at your instance schema and
+click on "display detailed view of metadata" you will see that there
+is a Euser entity in there. That's the one that is modeling users. The
+thing that corresponds to a UserProperty is a relationship between
+your entity and the Euser entity. As in:
+
+.. sourcecode:: python
class TodoItem(EntityType):
text = String()
todo_by = SubjectRelation('Euser')
- [XXX check that cw handle users better by
- mapping Google Accounts to local Euser entities automatically]
+[XXX check that cw handle users better by mapping Google Accounts to local Euser
+entities automatically]
How to reset the password for user joe ?
----------------------------------------
- You need to generate a new encrypted password::
+If you want to reset the admin password for ``myinstance``, do::
+
+ $ cubicweb-ctl reset-admin-pwd myinstance
+
+You need to generate a new encrypted password::
$ python
>>> from cubicweb.server.utils import crypt_password
@@ -362,7 +371,7 @@
'qHO8282QN5Utg'
>>>
- and paste it in the database::
+and paste it in the database::
$ psql mydb
mydb=> update cw_cwuser set cw_upassword='qHO8282QN5Utg' where cw_login='joe';
@@ -373,6 +382,6 @@
You are probably getting errors such as ::
- remove {'PR': 'Project', 'C': 'CWUser'} from solutions since your_user has no read access to cost
+ remove {'PR': 'Project', 'C': 'CWUser'} from solutions since your_user has no read access to cost
-This is because you have to put your user in the "users" group. The user has to be in both groups.
+This is because you have to put your user in the "users" group. The user has to be in both groups.
--- a/doc/book/en/annexes/rql/index.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/annexes/rql/index.rst Wed Jul 29 10:44:55 2009 +0200
@@ -8,5 +8,4 @@
intro
language
- dbapi
implementation
--- a/doc/book/en/annexes/rql/intro.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/annexes/rql/intro.rst Wed Jul 29 10:44:55 2009 +0200
@@ -5,41 +5,38 @@
Goals of RQL
~~~~~~~~~~~~
-The goal is to have a language emphasizing the way of browsing
-relations. As such, attributes will be regarded as cases of
-special relations (in terms of implementation, the language
-user should see virtually no difference between an attribute and a
+The goal is to have a language emphasizing the way of browsing relations. As
+such, attributes will be regarded as cases of special relations (in terms of
+implementation, the user should see no difference between an attribute and a
relation).
-RQL is inspired by SQL but is the highest level. A knowledge of the
-*CubicWeb* schema defining the application is necessary.
-
Comparison with existing languages
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SQL
```
-RQL builds on the features of SQL but is at a higher level
-(the current implementation of RQL generates SQL). For that it is limited
-to the way of browsing relations and introduces variables.
-The user does not need to know the model underlying SQL, but the *CubicWeb*
-schema defining the application.
+
+RQL may remind of SQL but works at a higher abstraction level (the *CubicWeb*
+framework generates SQL from RQL to fetch data from relation databases). RQL is
+focused on browsing relations. The user needs only to know about the *CubicWeb*
+data model he is querying, but not about the underlying SQL model.
+
+Sparql
+``````
+
+The query language most similar to RQL is SPARQL_, defined by the W3C to serve
+for the semantic web.
Versa
`````
-We should look in more detail, but here are already some ideas for
-the moment ... Versa_ is the language most similar to what we wanted
-to do, but the model underlying data being RDF, there is some
-number of things such as namespaces or handling of the RDF types which
-does not interest us. On the functionality level, Versa_ is very comprehensive
-including through many functions of conversion and basic types manipulation,
-which may need to be guided at one time or another.
-Finally, the syntax is a little esoteric.
-Sparql
-``````
-The query language most similar to RQL is SPARQL_, defined by the W3C to serve
-for the semantic web.
+We should look in more detail, but here are already some ideas for the moment
+... Versa_ is the language most similar to what we wanted to do, but the model
+underlying data being RDF, there is some number of things such as namespaces or
+handling of the RDF types which does not interest us. On the functionality
+level, Versa_ is very comprehensive including through many functions of
+conversion and basic types manipulation, which may need to be guided at one time
+or another. Finally, the syntax is a little esoteric.
The different types of queries
--- a/doc/book/en/conf.py Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/conf.py Wed Jul 29 10:44:55 2009 +0200
@@ -51,7 +51,7 @@
# The short X.Y version.
version = '0.54'
# The full version, including alpha/beta/rc tags.
-release = '3.2'
+release = '3.4'
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
--- a/doc/book/en/development/datamodel/baseschema.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/development/datamodel/baseschema.rst Wed Jul 29 10:44:55 2009 +0200
@@ -1,6 +1,6 @@
-Pre-defined schemas in the library
-----------------------------------
+Pre-defined entities in the library
+-----------------------------------
The library defines a set of entity schemas that are required by the system
or commonly used in *CubicWeb* instances.
@@ -28,7 +28,7 @@
Other entity types
~~~~~~~~~~~~~~~~~~
-* `CWCache`
+* `CWCache`, cache entities used to improve performances
* `CWProperty`, used to configure the instance
* `EmailAddress`, email address, used by the system to send notifications
--- a/doc/book/en/development/datamodel/define-workflows.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/development/datamodel/define-workflows.rst Wed Jul 29 10:44:55 2009 +0200
@@ -2,8 +2,8 @@
.. _Workflow:
-An Example: Workflow definition
-===============================
+Define a Workflow
+=================
General
-------
--- a/doc/book/en/development/datamodel/inheritance.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/development/datamodel/inheritance.rst Wed Jul 29 10:44:55 2009 +0200
@@ -2,4 +2,7 @@
Inheritance
-----------
+When describing a data model, entities can inherit from other entities as is
+common in object-oriented programming.
+
XXX WRITME
--- a/doc/book/en/development/devcore/index.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/development/devcore/index.rst Wed Jul 29 10:44:55 2009 +0200
@@ -5,7 +5,6 @@
:maxdepth: 1
vreg.rst
- selection.rst
appobject.rst
selectors.rst
dbapi.rst
--- a/doc/book/en/development/devcore/vreg.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/development/devcore/vreg.rst Wed Jul 29 10:44:55 2009 +0200
@@ -27,7 +27,7 @@
Examples:
-.. code-block:: python
+.. sourcecode:: python
# web/views/basecomponents.py
def registration_callback(vreg):
@@ -45,7 +45,7 @@
API d'enregistrement des objets
```````````````````````````````
-.. code-block:: python
+.. sourcecode:: python
register(obj, registryname=None, oid=None, clear=False)
--- a/doc/book/en/development/devrepo/sessions.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/development/devrepo/sessions.rst Wed Jul 29 10:44:55 2009 +0200
@@ -5,21 +5,22 @@
There are three kinds of sessions.
-* user sessions are the most common: they are related to users and
+* `user sessions` are the most common: they are related to users and
carry security checks coming with user credentials
-* super sessions are children of ordinary user sessions and allow to
+* `super sessions` are children of ordinary user sessions and allow to
bypass security checks (they are created by calling unsafe_execute
on a user session); this is often convenient in hooks which may
touch data that is not directly updatable by users
-* internal sessions have all the powers; they are also used in only a
+* `internal sessions` have all the powers; they are also used in only a
few situations where you don't already have an adequate session at
hand, like: user authentication, data synchronisation in
multi-source contexts
-Do not confuse the session type with their connection mode, for
-instance : 'in memory' or 'pyro'.
+.. note::
+ Do not confuse the session type with their connection mode, for
+ instance : 'in memory' or 'pyro'.
[WRITE ME]
--- a/doc/book/en/development/devweb/index.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/development/devweb/index.rst Wed Jul 29 10:44:55 2009 +0200
@@ -1,7 +1,7 @@
Web development
===============
-In this chapter, we will core api for web development in the CubicWeb framework.
+In this chapter, we will describe the core api for web development in the *CubicWeb* framework.
.. toctree::
:maxdepth: 1
--- a/doc/book/en/development/devweb/internationalization.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/development/devweb/internationalization.rst Wed Jul 29 10:44:55 2009 +0200
@@ -1,12 +1,12 @@
.. -*- coding: utf-8 -*-
-.. _internationalisation:
+.. _internationalization:
-Internationalisation
+Internationalization
---------------------
-Cubicweb fully supports the internalization of it's content and interface.
+Cubicweb fully supports the internalization of its content and interface.
Cubicweb's interface internationalization is based on the translation project `GNU gettext`_.
@@ -69,6 +69,8 @@
used by a particular instance's schema as they are generated
automatically.
+If you need to add messages on top of those that can be found in the source,
+you can create a file named `i18n/static-messages.pot`.
Handle the translation catalog
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- a/doc/book/en/development/devweb/views.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/development/devweb/views.rst Wed Jul 29 10:44:55 2009 +0200
@@ -1,3 +1,6 @@
+
+.. _Views:
+
Views
-----
@@ -76,8 +79,7 @@
- Using `templatable`, `content_type` and HTTP cache configuration
-.. code-block:: python
-
+.. sourcecode:: python
class RSSView(XMLView):
id = 'rss'
@@ -88,11 +90,9 @@
cache_max_age = 60*60*2 # stay in http cache for 2 hours by default
-
- Using custom selector
-.. code-block:: python
-
+.. sourcecode:: python
class SearchForAssociationView(EntityView):
"""view called by the edition view when the user asks
@@ -112,9 +112,9 @@
We'll show you now an example of a ``primary`` view and how to customize it.
If you want to change the way a ``BlogEntry`` is displayed, just override
-the method ``cell_call()`` of the view ``primary`` in ``BlogDemo/views.py`` ::
+the method ``cell_call()`` of the view ``primary`` in ``BlogDemo/views.py``:
-.. code-block:: python
+.. sourcecode:: python
from cubicweb.view import EntityView
from cubicweb.selectors import implements
@@ -148,7 +148,7 @@
Let us now improve the primary view of a blog
-.. code-block:: python
+.. sourcecode:: python
class BlogPrimaryView(EntityView):
id = 'primary'
@@ -215,9 +215,9 @@
[FILLME]
-
XML views, binaries...
----------------------
+
For views generating other formats than HTML (an image generated dynamically
for example), and which can not simply be included in the HTML page generated
by the main template (see above), you have to:
--- a/doc/book/en/development/entityclasses/index.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/development/entityclasses/index.rst Wed Jul 29 10:44:55 2009 +0200
@@ -2,7 +2,7 @@
===============
In this chapter, we will introduce the objects that are used to handle
-the data stored in the database.
+the logic associated to the data stored in the database.
.. toctree::
:maxdepth: 1
@@ -10,4 +10,4 @@
data-as-objects
load-sort
interfaces
- more
\ No newline at end of file
+ more
--- a/doc/book/en/development/entityclasses/interfaces.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/development/entityclasses/interfaces.rst Wed Jul 29 10:44:55 2009 +0200
@@ -1,16 +1,19 @@
Interfaces
----------
+Same thing as object-oriented programming interfaces.
+
XXX how to define a cw interface
Declaration of interfaces implemented by a class
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
XXX __implements__
Interfaces defined in the library
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.. automodule:: cubicweb.interface
- :members:
-`````````````
+automodule:: cubicweb.interface :members:
+
+
--- a/doc/book/en/development/entityclasses/load-sort.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/development/entityclasses/load-sort.rst Wed Jul 29 10:44:55 2009 +0200
@@ -1,15 +1,17 @@
+
+.. _FetchAttrs:
Loaded attributes and default sorting management
````````````````````````````````````````````````
-* The class attribute `fetch_attrs` allows to defined in an entity class
- a list of names of attributes or relations that should be automatically
- loaded when we recover the entities of this type. In the case of relations,
+* The class attribute `fetch_attrs` allows to define in an entity class a list
+ of names of attributes or relations that should be automatically loaded when
+ entities of this type are fetched from the database. In the case of relations,
we are limited to *subject of cardinality `?` or `1`* relations.
* The class method `fetch_order(attr, var)` expects an attribute (or relation)
name as a parameter and a variable name, and it should return a string
- to use in the requirement `ORDER BY` of an RQL query to automatically
+ to use in the requirement `ORDERBY` of an RQL query to automatically
sort the list of entities of such type according to this attribute, or
`None` if we do not want to sort on the attribute given in the parameter.
By default, the entities are sorted according to their creation date.
--- a/doc/book/en/development/index.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/development/index.rst Wed Jul 29 10:44:55 2009 +0200
@@ -18,3 +18,4 @@
testing/index
migration/index
webstdlib/index
+ profiling/index
--- a/doc/book/en/development/migration/index.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/development/migration/index.rst Wed Jul 29 10:44:55 2009 +0200
@@ -5,10 +5,10 @@
Migration
=========
-One of the main concept in *CubicWeb* is to create incremental applications.
-For this purpose, multiple actions are provided to facilitate the improvement
-of an instance, and in particular to handle the changes to be applied
-to the data model, without loosing existing data.
+One of the main design goals of *CubicWeb* was to support iterative and agile
+development. For this purpose, multiple actions are provided to facilitate the
+improvement of an instance, and in particular to handle the changes to be
+applied to the data model, without loosing existing data.
The current version of a cube (and of cubicweb itself) is provided in the file
`__pkginfo__.py` as a tuple of 3 integers.
@@ -129,12 +129,11 @@
* `drop_relation_definition(subjtype, rtype, objtype, commit=True)`, removes
a relation definition.
-* `sync_schema_props_perms(ertype=None, syncperms=True,
- syncprops=True, syncrdefs=True, commit=True)`,
+* `sync_schema_props_perms(ertype=None, syncperms=True, syncprops=True, syncrdefs=True, commit=True)`,
synchronizes properties and/or permissions on:
- * the whole schema if ertype is None
- * an entity or relation type schema if ertype is a string
- * a relation definition if ertype is a 3-uple (subject, relation, object)
+ - the whole schema if ertype is None
+ - an entity or relation type schema if ertype is a string
+ - a relation definition if ertype is a 3-uple (subject, relation, object)
* `change_relation_props(subjtype, rtype, objtype, commit=True, **kwargs)`, changes
properties of a relation definition by using the named parameters of the properties
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/book/en/development/profiling/index.rst Wed Jul 29 10:44:55 2009 +0200
@@ -0,0 +1,55 @@
+Profiling and performance
+=========================
+
+If you feel that one of your pages takes more time than it should to be
+generated, chances are that you're making too many RQL queries. Obviously,
+there are other reasons but experience tends to show this is the first thing to
+track down. Luckily, CubicWeb provides a configuration option to log RQL
+queries. In your ``all-in-one.conf`` file, set the **query-log-file** option::
+
+ # web application query log file
+ query-log-file=~/myapp-rql.log
+
+Then restart your application, reload your page and stop your application.
+The file ``myapp-rql.log`` now contains the list of RQL queries that were
+executed during your test. It's a simple text file containing lines such as::
+
+ Any A WHERE X eid %(x)s, X lastname A {'x': 448} -- (0.002 sec, 0.010 CPU sec)
+ Any A WHERE X eid %(x)s, X firstname A {'x': 447} -- (0.002 sec, 0.000 CPU sec)
+
+The structure of each line is::
+
+ <RQL QUERY> <QUERY ARGS IF ANY> -- <TIME SPENT>
+
+CubicWeb also provides the **exlog** command to examine and summarize data found
+in such a file:
+
+.. sourcecode:: sh
+
+ $ cubicweb-ctl exlog < ~/myapp-rql.log
+ 0.07 50 Any A WHERE X eid %(x)s, X firstname A {}
+ 0.05 50 Any A WHERE X eid %(x)s, X lastname A {}
+ 0.01 1 Any X,AA ORDERBY AA DESC WHERE E eid %(x)s, E employees X, X modification_date AA {}
+ 0.01 1 Any X WHERE X eid %(x)s, X owned_by U, U eid %(u)s {, }
+ 0.01 1 Any B,T,P ORDERBY lower(T) WHERE B is Bookmark,B title T, B path P, B bookmarked_by U, U eid %(x)s {}
+ 0.01 1 Any A,B,C,D WHERE A eid %(x)s,A name B,A creation_date C,A modification_date D {}
+
+This command sorts and uniquifies queries so that it's easy to see where
+is the hot spot that needs optimization.
+
+Do not neglect to set the **fetch_attrs** attribute you can define in your
+entity classes because it can greatly reduce the number of queries executed (see
+:ref:`FetchAttrs`).
+
+You should also know about the **profile** option in the ``all-in-on.conf``. If
+set, this option will make your application run in an `hotshot`_ session and
+store the results in the specified file.
+
+.. _hotshot: http://docs.python.org/library/hotshot.html#module-hotshot
+
+Last but no least, if you're using the PostgreSQL database backend, VACUUMing
+your database can significantly improve the performance of the queries (by
+updating the statistics used by the query optimizer). Nowadays, this is done
+automatically from time to time, but if you've just imported a large amount of
+data in your db, you will want to vacuum it (with the analyse option on). Read
+the documentation of your database for more information.
--- a/doc/book/en/development/webstdlib/editcontroller.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/development/webstdlib/editcontroller.rst Wed Jul 29 10:44:55 2009 +0200
@@ -1,4 +1,5 @@
.. -*- coding: utf-8 -*-
+
The 'edit' controller (:mod:`cubicweb.web.views.editcontroller`)
----------------------------------------------------------------
--- a/doc/book/en/development/webstdlib/primary.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/development/webstdlib/primary.rst Wed Jul 29 10:44:55 2009 +0200
@@ -15,7 +15,7 @@
Let's have a quick look at the EntityView ``PrimaryView`` as well as
its rendering method
-.. code-block:: python
+.. sourcecode:: python
class PrimaryView(EntityView):
"""the full view of an non final entity"""
--- a/doc/book/en/development/webstdlib/urlpublish.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/development/webstdlib/urlpublish.rst Wed Jul 29 10:44:55 2009 +0200
@@ -1,4 +1,5 @@
.. -*- coding: utf-8 -*-
+
URL Rewriting (:mod:`cubicweb.web.views.urlpublish`) and (:mod:`cubicweb.web.views.urlrewrite`)
------------------------------------------------------------------------------------------------
--- a/doc/book/en/development/webstdlib/xmlrss.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/development/webstdlib/xmlrss.rst Wed Jul 29 10:44:55 2009 +0200
@@ -1,3 +1,5 @@
+.. _XmlAndRss:
+
XML and RSS views (:mod:`cubicweb.web.views.xmlrss`)
----------------------------------------------------
--- a/doc/book/en/intro/concepts/index.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/intro/concepts/index.rst Wed Jul 29 10:44:55 2009 +0200
@@ -155,7 +155,7 @@
identifier in the same registry, At runtime, appobjects are selected in the
vregistry according to the context.
-Application objects are stored in the registry using a two level hierarchy :
+Application objects are stored in the registry using a two-level hierarchy :
object's `__registry__` : object's `id` : [list of app objects]
--- a/doc/book/en/intro/tutorial/components.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/intro/tutorial/components.rst Wed Jul 29 10:44:55 2009 +0200
@@ -39,6 +39,7 @@
* zone: Zone (to define places within larger places, for example a
city in a state in a country)
+.. _`CubicWeb Forge`: http://www.cubicweb.org/project/
Adding comments to BlogDemo
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -67,12 +68,12 @@
Once you modified your data model, you need to synchronize the
database with your model. For this purpose, *CubicWeb* provides
a very useful command ``cubicweb-ctl shell blogdemo`` which
-launches an interactive migration Python shell. (see
-:ref:`cubicweb-ctl` for more details))
-As you modified a relation from the `BlogEntry` schema,
-run the following command:
+launches an interactive shell where you can enter migration
+commands. (see :ref:`cubicweb-ctl` for more details))
+As you added the cube named `comment`, you need to run:
+
::
- synchronize_rschema('BlogEntry')
+ add_cube('comment')
-You can now start your instance and add comments to each `BlogEntry`.
+You can now start your instance and comment your blog entries.
--- a/doc/book/en/intro/tutorial/conclusion.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/intro/tutorial/conclusion.rst Wed Jul 29 10:44:55 2009 +0200
@@ -3,15 +3,13 @@
What's next?
------------
-We demonstrated how from a straight out of the box *CubicWeb*
-installation, you can build your web-application based on a
-schema. It's all already there: views, templates, permissions,
-etc. The step forward is now for you to customize according
-to your needs.
+We demonstrated how from a straight out of the box *CubicWeb* installation, you
+can build your web application based on a data model. It's all already there:
+views, templates, permissions, etc. The step forward is now for you to customize
+according to your needs.
-More than a web application, many features are available to
-extend your application, for example: RSS channel integration
-(:ref:`rss`), hooks (:ref:`hooks`), support of sources such as
-Google App Engine (:ref:`gaecontents`) and lots of others to
-discover through our book.
+Many features are available to extend your application, for example: RSS channel
+integration (:ref:`XmlAndRss`), hooks (:ref:`hooks`), support of sources such as
+Google App Engine (:ref:`GoogleAppEngineSource`) and lots of others to discover
+through our book.
--- a/doc/book/en/intro/tutorial/create-cube.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/intro/tutorial/create-cube.rst Wed Jul 29 10:44:55 2009 +0200
@@ -14,7 +14,7 @@
This will create in the cubes directory (``/path/to/forest/cubes`` for Mercurial
installation, ``/usr/share/cubicweb/cubes`` for debian packages installation)
-a directory named ``blog`` reflecting the structure described in :ref:`cubesConcepts`.
+a directory named ``blog`` reflecting the structure described in :ref:`Concepts`.
.. _DefineDataModel:
@@ -91,8 +91,8 @@
.. image:: ../../images/blog-demo-first-page.png
-Please notice that so far, the *CubicWeb* franework managed all aspects of
-the web application based on the schema provided at first.
+Please notice that so far, the *CubicWeb* framework managed all aspects of
+the web application based on the schema provided at the beginning.
Add entities
@@ -222,7 +222,7 @@
To do so, please apply the following changes:
-.. code-block:: python
+.. sourcecode:: python
from cubicweb.web.views import baseviews
@@ -268,6 +268,7 @@
The view has a ``self.w()`` method that is used to output data, in our
example HTML output.
-You can find more details about views and selectors in :ref:`ViewDefinition`.
+.. note::
+ You can find more details about views and selectors in :ref:`ViewDefinition`.
--- a/doc/book/en/intro/tutorial/maintemplate.rst Wed Jul 29 10:44:36 2009 +0200
+++ b/doc/book/en/intro/tutorial/maintemplate.rst Wed Jul 29 10:44:55 2009 +0200
@@ -36,15 +36,15 @@
Customize header
`````````````````
-Let's now move the search box in the header and remove the login form
-from the header. We'll show how to move it to the left column of the application.
+Let's now move the search box in the header and remove the login form from the
+header. We'll show how to move it to the left column of the user interface.
Let's say we do not want anymore the login menu to be in the header
First, to remove the login menu, we just need to comment out the display of the
login graphic component such as follows:
-.. code-block :: python
+.. sourcecode:: python
class MyBlogHTMLPageHeader(HTMLPageHeader):
@@ -89,9 +89,9 @@
````````````````
If you want to change the footer for example, look
-for HTMLPageFooter and override it in your views file as in: ::
+for HTMLPageFooter and override it in your views file as in:
-..code-block :: python
+.. sourcecode:: python
from cubicweb.web.views.basetemplates import HTMLPageFooter
--- a/i18n/entities.pot Wed Jul 29 10:44:36 2009 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-msgid "__msg state changed"
-msgstr ""
-
-msgid "managers"
-msgstr ""
-
-msgid "users"
-msgstr ""
-
-msgid "guests"
-msgstr ""
-
-msgid "owners"
-msgstr ""
-
-msgid "read_perm"
-msgstr ""
-
-msgid "add_perm"
-msgstr ""
-
-msgid "update_perm"
-msgstr ""
-
-msgid "delete_perm"
-msgstr ""
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/i18n/static-messages.pot Wed Jul 29 10:44:55 2009 +0200
@@ -0,0 +1,11 @@
+msgid "read_perm"
+msgstr ""
+
+msgid "add_perm"
+msgstr ""
+
+msgid "update_perm"
+msgstr ""
+
+msgid "delete_perm"
+msgstr ""
--- a/schema.py Wed Jul 29 10:44:36 2009 +0200
+++ b/schema.py Wed Jul 29 10:44:55 2009 +0200
@@ -17,11 +17,12 @@
from logilab.common.deprecation import obsolete
from logilab.common.compat import any
-from yams import BadSchemaDefinition, buildobjs as ybo, constraints
+from yams import BadSchemaDefinition, buildobjs as ybo
from yams.schema import Schema, ERSchema, EntitySchema, RelationSchema
-from yams.constraints import BaseConstraint, StaticVocabularyConstraint
-from yams.reader import CONSTRAINTS, PyFileReader, SchemaLoader, \
- obsolete as yobsolete, cleanup_sys_modules
+from yams.constraints import (BaseConstraint, StaticVocabularyConstraint,
+ FormatConstraint)
+from yams.reader import (CONSTRAINTS, PyFileReader, SchemaLoader,
+ obsolete as yobsolete, cleanup_sys_modules)
from rql import parse, nodes, RQLSyntaxError, TypeResolverException
@@ -896,7 +897,7 @@
PERM_USE_TEMPLATE_FORMAT = _('use_template_format')
NEED_PERM_FORMATS = [_('text/cubicweb-page-template')]
-@monkeypatch(constraints.FormatConstraint)
+@monkeypatch(FormatConstraint)
def vocabulary(self, entity=None, req=None):
if req is None and entity is not None:
req = entity.req
--- a/web/data/cubicweb.compat.js Wed Jul 29 10:44:36 2009 +0200
+++ b/web/data/cubicweb.compat.js Wed Jul 29 10:44:55 2009 +0200
@@ -247,9 +247,10 @@
if ('name' in params){
try {
var node = document.createElement('<iframe name="'+params['name']+'">');
- }catch (ex) {
- var node = document.createElement('iframe');
- }
+ } catch (ex) {
+ var node = document.createElement('iframe');
+ node.id = node.name = params.name;
+ }
}
else{
var node = document.createElement('iframe');
--- a/web/formfields.py Wed Jul 29 10:44:36 2009 +0200
+++ b/web/formfields.py Wed Jul 29 10:44:55 2009 +0200
@@ -478,6 +478,9 @@
super(CompoundField, self).__init__(*args, **kwargs)
self.fields = fields
+ def subfields(self, form):
+ return self.fields
+
def actual_fields(self, form):
return [self] + list(self.fields)
--- a/web/formwidgets.py Wed Jul 29 10:44:36 2009 +0200
+++ b/web/formwidgets.py Wed Jul 29 10:44:55 2009 +0200
@@ -291,9 +291,9 @@
subst = self.attrs.get('label_input_substitution', '%(label)s %(input)s')
fields = [subst % {'label': renderer.render_label(form, f),
'input': f.render(form, renderer)}
- for f in field.fields]
+ for f in field.subfields(form)]
else:
- fields = [f.render(form, renderer) for f in field.fields]
+ fields = [f.render(form, renderer) for f in field.subfields(form)]
return u'<div>%s</div>' % ' '.join(fields)
--- a/web/views/formrenderers.py Wed Jul 29 10:44:36 2009 +0200
+++ b/web/views/formrenderers.py Wed Jul 29 10:44:55 2009 +0200
@@ -199,7 +199,7 @@
w(u'<legend>%s</legend>' % self.req._(fieldset))
w(u'<table class="%s">' % self.table_class)
for field in fields:
- w(u'<tr id="%s_%s">' % (field.name, field.role))
+ w(u'<tr id="%s_%s_row">' % (field.name, field.role))
if self.display_label:
w(u'<th class="labelCol">%s</th>' % self.render_label(form, field))
error = form.form_field_error(field)