# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1231935964 -3600 # Node ID 221886d8e3c84bb31937e24398a783f27cd350dd # Parent e0cb1579eba23a2e62b724dd125ff5a9724537ed# Parent 295f3cd70915df82bf2b16104c5560e8284af776 merge diff -r e0cb1579eba2 -r 221886d8e3c8 doc/book/en/A03a-concepts.en.txt --- a/doc/book/en/A03a-concepts.en.txt Wed Jan 14 13:25:38 2009 +0100 +++ b/doc/book/en/A03a-concepts.en.txt Wed Jan 14 13:26:04 2009 +0100 @@ -385,7 +385,7 @@ Standard structure for a cube ````````````````````````````` -A complex cube is structured as follows: +A cube is structured as follows: :: @@ -426,7 +426,7 @@ | |-- site_cubicweb.py | - |-- sobjects.py + |-- hooks.py | |-- test/ | |-- data/ @@ -438,7 +438,8 @@ `-- views.py -We can use simple Python module instead of packages, for example: +We can use subpackages instead of python modules for ``views.py``, ``entities.py``, +``schema.py`` or ``hooks.py``. For example, we could have: :: @@ -446,8 +447,11 @@ | |-- entities.py |-- hooks.py - \-- views.py - + `-- views/ + |-- forms.py + |-- primary.py + `-- widgets.py + where : @@ -486,32 +490,47 @@ The available application entities are: -* addressbook: PhoneNumber and PostalAddress +* addressbook_: PhoneNumber and PostalAddress -* basket: Basket (like a shopping cart) +* basket_: Basket (like a shopping cart) -* blog: Blog (a *very* basic blog) +* blog_: Blog (a *very* basic blog) -* classfolder: Folder (to organize things but grouping them in folders) +* comment_: Comment (to attach comment threads to entities) + +* event_: Event (define events, display them in calendars) -* classtags: Tag (to tag anything) +* file_: File (to allow users to upload and store binary or text files) -* file: File (to allow users to upload and store binary or text files) +* folder_: Folder (to organize things but grouping them in folders) -* link: Link (to collect links to web resources) +* keyword_: Keyword (to define classification schemes) -* mailinglist: MailingList (to reference a mailing-list and the URLs +* link_: Link (to collect links to web resources) + +* mailinglist_: MailingList (to reference a mailing-list and the URLs for its archives and its admin interface) -* person: Person (easily mixed with addressbook) +* person_: Person (easily mixed with addressbook) + +* tag_: Tag (to tag anything) -* task: Task (something to be done between start and stop date) +* task_: Task (something to be done between start and stop date) -* zone: Zone (to define places within larger places, for example a +* zone_: Zone (to define places within larger places, for example a city in a state in a country) -The available system entities are: - -* comment: Comment (to attach comment threads to entities) - - +.. _addressbook: http://www.cubicweb.org/project/cubicweb-addressbook +.. _basket: http://www.cubicweb.org/project/cubicweb-basket +.. _blog: http://www.cubicweb.org/project/cubicweb-blog +.. _comment: http://www.cubicweb.org/project/cubicweb-comment +.. _event: http://www.cubicweb.org/project/cubicweb-event +.. _file: http://www.cubicweb.org/project/cubicweb-file +.. _folder: http://www.cubicweb.org/project/cubicweb-folder +.. _keyword: http://www.cubicweb.org/project/cubicweb-keyword +.. _link: http://www.cubicweb.org/project/cubicweb-link +.. _mailinglist: http://www.cubicweb.org/project/cubicweb-mailinglist +.. _person: http://www.cubicweb.org/project/cubicweb-person +.. _tag: http://www.cubicweb.org/project/cubicweb-tag +.. _task: http://www.cubicweb.org/project/cubicweb-task +.. _zone: http://www.cubicweb.org/project/cubicweb-zone diff -r e0cb1579eba2 -r 221886d8e3c8 doc/book/en/C040-rql.en.txt --- a/doc/book/en/C040-rql.en.txt Wed Jan 14 13:25:38 2009 +0100 +++ b/doc/book/en/C040-rql.en.txt Wed Jan 14 13:26:04 2009 +0100 @@ -108,22 +108,22 @@ - *Looking for people working for eurocopter interested in training* :: - Person P WHERE - P work_for P, S name 'Eurocopter' + Any P WHERE + P is Person, P work_for P, S name 'Eurocopter' P interested_by T, T name 'training' - *Search note less than 10 days old written by jphc or ocy* :: - Note N WHERE - N written_on D, D day> (today -10), + Any N WHERE + N is Note, N written_on D, D day> (today -10), N written_by P, P name 'jphc' or P name 'ocy' - *Looking for people interested in training or living in Paris* :: - Person P WHERE - (P interested_by T, T name 'training') or + Any P WHERE + P is Person, (P interested_by T, T name 'training') OR (P city 'Paris') - *The name and surname of all people* @@ -158,7 +158,7 @@ - *Insert a new person named 'foo'* :: - INSERT Person X: X name 'widget' + INSERT Person X: X name 'foo' - *Insert a new person named 'foo', another called 'nice' and a 'friend' relation between them* @@ -211,6 +211,56 @@ DELETE X friend Y WHERE X is Person, X name 'foo' +Undocumented (yet) type of queries +---------------------------------- + +**Limit / offset** +:: + + Any P ORDERBY N LIMIT 5 OFFSET 10 WHERE P is Person, P firstname N + +**Function calls** +:: + + Any UPPER(N) WHERE P firstname N + +**Exists** +:: + + Any X ORDERBY PN,N + WHERE X num N, X version_of P, P name PN, + EXISTS(X in_state S, S name IN ("dev", "ready")) + OR EXISTS(T tags X, T name "priority") + +**Left outer join** +:: + + Any T,P,V WHERE T is Ticket, T concerns P, T done_in V? + + +**Having** +:: + + Any X GROUPBY X WHERE X knows Y HAVING COUNT(Y) > 10 + +**Simple union** +:: + + (Any X WHERE X is Person) UNION (Any X WHERE X is Company) + +**Complex union** +:: + + DISTINCT Any W, REF + WITH W, REF BEING + ( + (Any W, REF WHERE W is Workcase, W ref REF, + W concerned_by D, D name "Logilab") + UNION + (Any W, REF WHERE W is Workcase, W ref REF, ' + W split_into WP, WP name "WP1") + ) + Language definition =================== @@ -222,10 +272,11 @@ :: DISTINCT, INSERT, SET, DELETE, - WHERE, AND, OR, NOT - IN, LIKE, - TRUE, FALSE, NULL, TODAY, NOW - GROUPBY, ORDERBY, ASC, DESC + WHERE, AND, OR, NOT, EXISTS, + IN, LIKE, UNION, WITH, BEING, + TRUE, FALSE, NULL, TODAY, NOW, + LIMIT, OFFSET, + HAVING, GROUPBY, ORDERBY, ASC, DESC Variables and Typing