doc/book/en/annexes/faq.rst
branchstable
changeset 5156 0ec436cba1a6
parent 4936 a4b772a0d801
child 5157 1202e6565aff
equal deleted inserted replaced
5154:834269261ae4 5156:0ec436cba1a6
     3 Frequently Asked Questions
     3 Frequently Asked Questions
     4 ==========================
     4 ==========================
     5 
     5 
     6 [XXX 'copy answer from forum' means reusing text from
     6 [XXX 'copy answer from forum' means reusing text from
     7 http://groups.google.com/group/google-appengine/browse_frm/thread/c9476925f5f66ec6
     7 http://groups.google.com/group/google-appengine/browse_frm/thread/c9476925f5f66ec6
     8 and
       
     9 http://groups.google.com/group/google-appengine/browse_frm/thread/d791ce17e2716147/eb078f8cfe8426e0
       
    10 and
     8 and
    11 http://groups.google.com/group/google-appengine/browse_frm/thread/f48cf6099973aef5/c28cd6934dd72457
     9 http://groups.google.com/group/google-appengine/browse_frm/thread/f48cf6099973aef5/c28cd6934dd72457
    12 ]
    10 ]
    13 
    11 
    14 Why does not CubicWeb have a template language ?
    12 Why does not CubicWeb have a template language ?
    24 and developpers develop without the use of the templating language
    22 and developpers develop without the use of the templating language
    25 as an intermediary that could not be anyway efficient for both parties.
    23 as an intermediary that could not be anyway efficient for both parties.
    26 Python is the templating language that we use in *CubicWeb*, but again,
    24 Python is the templating language that we use in *CubicWeb*, but again,
    27 it does not prevent you from using a templating language.
    25 it does not prevent you from using a templating language.
    28 
    26 
    29 The reason template languages are not used in this book is that
    27 Moreover, CubicWeb currently supports `simpletal`_ out of the box and
    30 experience has proved us that using pure python was less cumbersome.
    28 it is also possible to use the `cwtags`_ library to build html trees
       
    29 using the `with statement`_ with more comfort than raw strings.
       
    30 
       
    31 .. _`simpletal`: http://www.owlfish.com/software/simpleTAL/
       
    32 .. _`cwtags`: http://www.cubicweb.org/project/cwtags
       
    33 .. _`with statement`: http://www.python.org/dev/peps/pep-0343/
    31 
    34 
    32 Why do you think using pure python is better than using a template language ?
    35 Why do you think using pure python is better than using a template language ?
    33 -----------------------------------------------------------------------------
    36 -----------------------------------------------------------------------------
    34 
    37 
    35 Python is an Object Oriented Programming language and as such it
    38 Python is an Object Oriented Programming language and as such it
    36 already provides a consistent and strong architecture and syntax
    39 already provides a consistent and strong architecture and syntax
    37 a templating language would not reach.
    40 a templating language would not reach.
    38 
       
    39 When doing development, you need a real language and template
       
    40 languages are not real languages.
       
    41 
    41 
    42 Using Python instead of a template langage for describing the user interface
    42 Using Python instead of a template langage for describing the user interface
    43 makes it to maintain with real functions/classes/contexts without the need of
    43 makes it to maintain with real functions/classes/contexts without the need of
    44 learning a new dialect. By using Python, we use standard OOP techniques and
    44 learning a new dialect. By using Python, we use standard OOP techniques and
    45 this is a key factor in a robust application.
    45 this is a key factor in a robust application.
    46 
    46 
    47 The `cwtags` (http://www.cubicweb.org/project/cwtags) package can be
       
    48 used in cubes to help generate html from Python with more comfort than
       
    49 raw strings.
       
    50 
       
    51 Why do you use the LGPL license to prevent me from doing X ?
    47 Why do you use the LGPL license to prevent me from doing X ?
    52 ------------------------------------------------------------
    48 ------------------------------------------------------------
    53 
    49 
    54 LGPL means that *if* you redistribute your application, you need to
    50 LGPL means that *if* you redistribute your application, you need to
    55 redistribute the changes you made to CubicWeb under the LGPL licence.
    51 redistribute the changes you made to CubicWeb under the LGPL licence.
    56 
    52 
    57 Publishing a web site has nothing to do with redistributing
    53 Publishing a web site has nothing to do with redistributing source
    58 source code. A fair amount of companies use modified LGPL code
    54 code according to the terms of the LGPL. A fair amount of companies
    59 for internal use. And someone could publish a *CubicWeb* component
    55 use modified LGPL code for internal use. And someone could publish a
    60 under a BSD licence for others to plug into a LGPL framework without
    56 *CubicWeb* component under a BSD licence for others to plug into a
    61 any problem. The only thing we are trying to prevent here is someone
    57 LGPL framework without any problem. The only thing we are trying to
    62 taking the framework and packaging it as closed source to his own
    58 prevent here is someone taking the framework and packaging it as
    63 clients.
    59 closed source to his own clients.
    64 
    60 
    65 
    61 
    66 CubicWeb looks pretty recent. Is it stable ?
    62 CubicWeb looks pretty recent. Is it stable ?
    67 --------------------------------------------
    63 --------------------------------------------
    68 
    64 
    75 
    71 
    76 It may remind you of SQL but it is higher level than SQL, more like
    72 It may remind you of SQL but it is higher level than SQL, more like
    77 SPARQL. Except that SPARQL did not exist when we started the project.
    73 SPARQL. Except that SPARQL did not exist when we started the project.
    78 With version 3.4, CubicWeb has support for SPARQL.
    74 With version 3.4, CubicWeb has support for SPARQL.
    79 
    75 
    80 That RQL language is what is going to make a difference with django-
    76 The RQL language is what is going to make a difference with django-
    81 like frameworks for several reasons.
    77 like frameworks for several reasons.
    82 
    78 
    83 1. accessing data is *much* easier with it. One can write complex
    79 1. accessing data is *much* easier with it. One can write complex
    84    queries with RQL that would be tedious to define and hard to maintain
    80    queries with RQL that would be tedious to define and hard to maintain
    85    using an object/filter suite of method calls.
    81    using an object/filter suite of method calls.
   190 An HTML template cannot contain code, hence it is only about static
   186 An HTML template cannot contain code, hence it is only about static
   191 content.  A component is made of code and operations that apply on a
   187 content.  A component is made of code and operations that apply on a
   192 well defined context (request, result set). It enables much more
   188 well defined context (request, result set). It enables much more
   193 dynamic views.
   189 dynamic views.
   194 
   190 
   195 What is the difference between `AppRsetObject` and `AppObject` ?
       
   196 ----------------------------------------------------------------
       
   197 
       
   198 `AppRsetObject` instances are selected on a request and a result
       
   199 set. `AppObject` instances are directly selected by id.
       
   200 
       
   201 How to update a database after a schema modification ?
   191 How to update a database after a schema modification ?
   202 ------------------------------------------------------
   192 ------------------------------------------------------
   203 
   193 
   204 It depends on what has been modified in the schema.
   194 It depends on what has been modified in the schema.
   205 
   195 
   206 * Update the permissions and properties of an entity or a relation:
   196 * update the permissions and properties of an entity or a relation:
   207   ``sync_schema_props_perms('MyEntityOrRelation')``.
   197   ``sync_schema_props_perms('MyEntityOrRelation')``.
   208 
   198 
   209 * Add an attribute: ``add_attribute('MyEntityType', 'myattr')``.
   199 * add an attribute: ``add_attribute('MyEntityType', 'myattr')``.
   210 
   200 
   211 * Add a relation: ``add_relation_definition('SubjRelation', 'MyRelation', 'ObjRelation')``.
   201 * add a relation: ``add_relation_definition('SubjRelation', 'MyRelation', 'ObjRelation')``.
   212 
   202 
   213 
   203 
   214 How to create an anonymous user ?
   204 How to create an anonymous user ?
   215 ---------------------------------
   205 ---------------------------------
   216 
   206 
   399 You are probably getting errors such as ::
   389 You are probably getting errors such as ::
   400 
   390 
   401   remove {'PR': 'Project', 'C': 'CWUser'} from solutions since your_user has no read access to cost
   391   remove {'PR': 'Project', 'C': 'CWUser'} from solutions since your_user has no read access to cost
   402 
   392 
   403 This is because you have to put your user in the "users" group. The user has to be in both groups.
   393 This is because you have to put your user in the "users" group. The user has to be in both groups.
       
   394 
       
   395 How do I translate an msg id defined (and translated) in another cube ?
       
   396 -----------------------------------------------------------------------
       
   397 
       
   398 You should but these translations in the `i18n/static-messages.pot`
       
   399 file of your own cube.