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 |