author | Aurelien Campeas <aurelien.campeas@logilab.fr> |
Wed, 07 Jan 2009 12:25:18 +0100 | |
changeset 344 | e0d5879a613e |
parent 337 | eb329d0db467 |
child 345 | 31f88b2e3500 |
permissions | -rw-r--r-- |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
1 |
.. -*- coding: utf-8 -*- |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
2 |
|
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
3 |
Frequently Asked Questions |
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
4 |
========================== |
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
5 |
|
310
cdd2b1247c50
[doc] add links to google-appengine forum
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
306
diff
changeset
|
6 |
[XXX 'copy answer from forum' means reusing text from |
cdd2b1247c50
[doc] add links to google-appengine forum
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
306
diff
changeset
|
7 |
http://groups.google.com/group/google-appengine/browse_frm/thread/c9476925f5f66ec6 |
cdd2b1247c50
[doc] add links to google-appengine forum
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
306
diff
changeset
|
8 |
and |
cdd2b1247c50
[doc] add links to google-appengine forum
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
306
diff
changeset
|
9 |
http://groups.google.com/group/google-appengine/browse_frm/thread/d791ce17e2716147/eb078f8cfe8426e0 |
cdd2b1247c50
[doc] add links to google-appengine forum
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
306
diff
changeset
|
10 |
and |
cdd2b1247c50
[doc] add links to google-appengine forum
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
306
diff
changeset
|
11 |
http://groups.google.com/group/google-appengine/browse_frm/thread/f48cf6099973aef5/c28cd6934dd72457 |
cdd2b1247c50
[doc] add links to google-appengine forum
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
306
diff
changeset
|
12 |
] |
cdd2b1247c50
[doc] add links to google-appengine forum
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
306
diff
changeset
|
13 |
|
306
1ed1da008e50
[doc] Removes references to LAX.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
199
diff
changeset
|
14 |
* Why does not CubicWeb have a template language ? |
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
15 |
|
344
e0d5879a613e
tweak the faq a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
337
diff
changeset
|
16 |
There are enough template languages out there. You can use your |
e0d5879a613e
tweak the faq a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
337
diff
changeset
|
17 |
preferred template language if you want. [explain how to use a |
e0d5879a613e
tweak the faq a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
337
diff
changeset
|
18 |
template language] |
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
19 |
|
337
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
20 |
`CubicWeb` does not define its own templating language as this was |
344
e0d5879a613e
tweak the faq a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
337
diff
changeset
|
21 |
not our goal. Based on our experience, we realized that |
337
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
22 |
we could gain productivity by letting designers use design tools |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
23 |
and developpers develop without the use of the templating language |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
24 |
as an intermediary that could not be anyway efficient for both parties. |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
25 |
Python is the templating language that we use in `CubicWeb`, but again, |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
26 |
it does not prevent you from using a templating language. |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
27 |
|
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
28 |
The reason template languages are not used in this book is that |
344
e0d5879a613e
tweak the faq a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
337
diff
changeset
|
29 |
experience has proved us that using pure python was less cumbersome. |
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
30 |
|
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
31 |
* Why do you think using pure python is better than using a template language ? |
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
32 |
|
337
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
33 |
Python is an Object Oriented Programming language and as such it |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
34 |
already provides a consistent and strong architecture and syntax |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
35 |
a templating language would not reach. |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
36 |
|
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
37 |
When doing development, you need a real language and template |
344
e0d5879a613e
tweak the faq a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
337
diff
changeset
|
38 |
languages are not real languages. |
337
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
39 |
|
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
40 |
Using Python enables developing applications for which code is |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
41 |
easier to maintain with real functions/classes |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
42 |
without the need of learning a new dialect. By using Python, |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
43 |
we use standard OOP techniques and this is a key factor in a |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
44 |
robust application. |
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
45 |
|
337
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
46 |
* Why do you use the GPL license to prevent me from doing X? |
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
47 |
|
337
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
48 |
GPL means that *if* you redistribute your application, you need to |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
49 |
redistribute it *and* the changes you made *and* the code _linked_ |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
50 |
to it under the GPL licence. |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
51 |
|
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
52 |
Publishing a web site has nothing to do with redistributing |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
53 |
source code. A fair amount of companies use modified GPL code |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
54 |
for internal use. And someone could publish a `CubicWeb` component |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
55 |
under a BSD licence for others to plug into a GPL framework without |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
56 |
any problem. The only thing we are trying to prevent here is someone |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
57 |
taking the framework and packaging it as closed source to his own |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
58 |
clients. |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
59 |
|
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
60 |
|
306
1ed1da008e50
[doc] Removes references to LAX.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
199
diff
changeset
|
61 |
* CubicWeb looks pretty recent. Is it stable ? |
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
62 |
|
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
63 |
[answer that framework has evolved over the past seven years and that |
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
64 |
data migrated from one schema to the other ever since] |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
65 |
|
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
66 |
* Why is the RQL query language looking similar to X ? |
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
67 |
|
337
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
68 |
It may remind you of SQL but it is higher level than SQL, more like |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
69 |
SPARQL. Except that SPARQL did not exist when we started the project. |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
70 |
Having SPARQL has a query language has been in our backlog for years. |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
71 |
|
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
72 |
That RQL language is what is going to make a difference with django- |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
73 |
like frameworks for several reasons. |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
74 |
|
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
75 |
1. accessing data is *much* easier with it. One can write complex |
344
e0d5879a613e
tweak the faq a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
337
diff
changeset
|
76 |
queries with RQL that would be tedious to define and hard to maintain |
337
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
77 |
using an object/filter suite of method calls. |
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
78 |
|
344
e0d5879a613e
tweak the faq a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
337
diff
changeset
|
79 |
2. it offers an abstraction layer allowing your applications to run |
e0d5879a613e
tweak the faq a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
337
diff
changeset
|
80 |
on multiple back-ends. That means not only various SQL backends |
e0d5879a613e
tweak the faq a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
337
diff
changeset
|
81 |
(postgresql, sqlite, mysql), but also multiple databases at the |
e0d5879a613e
tweak the faq a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
337
diff
changeset
|
82 |
same time, and also non-SQL data stores like LDAP directories and |
e0d5879a613e
tweak the faq a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
337
diff
changeset
|
83 |
subversion/mercurial repositories (see the `vcsfile` |
e0d5879a613e
tweak the faq a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
337
diff
changeset
|
84 |
component). Google App Engine is yet another supported target for |
e0d5879a613e
tweak the faq a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
337
diff
changeset
|
85 |
RQL. |
337
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
86 |
|
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
87 |
[copy answer from forum, explain why similar to sparql and why better |
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
88 |
than django and SQL] |
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
89 |
|
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
90 |
* which ajax library |
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
91 |
|
317
cf1c6178b322
we've been using jquery for a while now
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
310
diff
changeset
|
92 |
[we use jquery and things on top of that] |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
93 |
|
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
94 |
* `Error while publishing rest text ...` |
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
95 |
|
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
96 |
While modifying the description of an entity, you get an error message in |
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
97 |
the application `Error while publishing ...` for Rest text and plain text. |
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
98 |
The server returns a traceback like as follows :: |
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
99 |
|
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
100 |
2008-10-06 15:05:08 - (erudi.rest) ERROR: error while publishing ReST text |
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
101 |
Traceback (most recent call last): |
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
102 |
File "/home/sandrine/src/blogdemo/ginco/common/rest.py", line 217, in rest_publish |
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
103 |
File "/usr/lib/python2.5/codecs.py", line 817, in open |
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
104 |
file = __builtin__.open(filename, mode, buffering) |
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
105 |
TypeError: __init__() takes at most 3 arguments (4 given) |
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
106 |
|
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
107 |
|
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
108 |
This can be fixed by applying the patch described in : |
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
109 |
http://code.google.com/p/googleappengine/issues/detail?id=48 |
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
110 |
|
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
111 |
* What are hooks used for? |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
112 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
113 |
Les crochets sont appeles lorsqu'une requete RQL est executee. Cela |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
114 |
permet d'executer des actions specifiques lors d'un acces a la base |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
115 |
de donnees, ce qui donne un controle de la base de donnees afin de |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
116 |
prevenir l'insertion de `mauvaises` entites dans la base. |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
117 |
|
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
118 |
* When should you define an HTML template rather than define a graphical component? |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
119 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
120 |
Un template HTML ne peut contenir de logique, il ne permettra donc |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
121 |
que de definir une vue statique. Un composant permet lui de gerer |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
122 |
plus de logique et d'operations sur le contexte dans lequel il |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
123 |
s'applique. Il faut donc bien reflechir avant de decider de l'un ou |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
124 |
de l'autre, mais vous avez la possibilite de choisir. |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
125 |
|
199
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
126 |
* What is the difference between `AppRsetObject` and `AppObject` ? |
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
127 |
|
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
128 |
La différence entre la classe `AppRsetObject` et la classe `AppObject` est que |
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
129 |
les instances de la premières sont séléctionnées pour une requête et un "result |
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
130 |
set" et alors que les secondes ne sont séléctionnées qu'en fonction de leur |
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
131 |
identifiant. |
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
132 |
|
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
133 |
HOW TO |
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
134 |
====== |
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
135 |
|
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
136 |
[TO COMPLETE] |
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
137 |
|
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
138 |
|
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
139 |
* How to update a database after a schema modification? |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
140 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
141 |
Cela dépend de ce qui a été modifié dans le schéma. |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
142 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
143 |
* Modification d'une relation non finale |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
144 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
145 |
* Modification d'une relation finale |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
146 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
147 |
|
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
148 |
* How to create an anonymous user? |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
149 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
150 |
Cela vous permet d'acceder a votre site sans avoir besoin de vous authentifier. |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
151 |
Dans le fichier ``all-in-one.conf`` de votre instance, définir l'utilisateur |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
152 |
anonyme en initilisant les valeurs des variables suivantes :: |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
153 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
154 |
# login of the Erudi user account to use for anonymous user (if you want to |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
155 |
# allow anonymous) |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
156 |
anonymous-user=anon |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
157 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
158 |
# password of the Erudi user account matching login |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
159 |
anonymous-password=anon |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
160 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
161 |
Vous devez aussi vous assurer que cet utilisateur `anon` existe dans la base |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
162 |
de données, le plus simple étant de s'identifier sur votre application en |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
163 |
administrateur et de rajouter l'utilisateur `anon` via l'interface d'administration. |
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
164 |
|
199
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
165 |
|
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
166 |
* How to change the application logo? |
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
167 |
|
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
168 |
There are two ways of changing the logo. |
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
169 |
|
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
170 |
1. The easiest way to use a different logo is to replace the existing |
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
171 |
``logo.png`` in ``myapp/data`` by your prefered icon and refresh. |
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
172 |
By default all application will look for a ``logo.png`` to be |
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
173 |
rendered in the logo section. |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
174 |
|
199
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
175 |
.. image:: images/lax-book.06-main-template-logo.en.png |
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
176 |
|
199
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
177 |
2. In your cube directory, you can specify which file to use for the logo. |
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
178 |
This is configurable in ``mycube/data/external_resources``: :: |
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
179 |
|
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
180 |
LOGO = DATADIR/path/to/mylogo.gif |
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
181 |
|
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
182 |
where DATADIR is ``mycubes/data``. |
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
183 |
|
335
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
184 |
* How to import LDAP users in `CubicWeb`? |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
185 |
|
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
186 |
Here is a very usefull script which enables you to import LDAP users |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
187 |
into your `CubicWeb` application by runing the following: :: |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
188 |
|
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
189 |
|
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
190 |
import os |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
191 |
import pwd |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
192 |
import sys |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
193 |
|
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
194 |
from logilab.common.db import get_connection |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
195 |
|
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
196 |
def getlogin(): |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
197 |
"""avoid usinng os.getlogin() because of strange tty / stdin problems |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
198 |
(man 3 getlogin) |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
199 |
Another solution would be to use $LOGNAME, $USER or $USERNAME |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
200 |
""" |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
201 |
return pwd.getpwuid(os.getuid())[0] |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
202 |
|
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
203 |
|
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
204 |
try: |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
205 |
database = sys.argv[1] |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
206 |
except IndexError: |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
207 |
print 'USAGE: python ldap2system.py <database>' |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
208 |
sys.exit(1) |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
209 |
|
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
210 |
if raw_input('update %s db ? [y/n]: ' % database).strip().lower().startswith('y'): |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
211 |
cnx = get_connection(user=getlogin(), database=database) |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
212 |
cursor = cnx.cursor() |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
213 |
|
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
214 |
insert = ('INSERT INTO euser (creation_date, eid, modification_date, login, firstname, surname, last_login_time, upassword) ' |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
215 |
"VALUES (%(mtime)s, %(eid)s, %(mtime)s, %(login)s, %(firstname)s, %(surname)s, %(mtime)s, './fqEz5LeZnT6');") |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
216 |
update = "UPDATE entities SET source='system' WHERE eid=%(eid)s;" |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
217 |
cursor.execute("SELECT eid,type,source,extid,mtime FROM entities WHERE source!='system'") |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
218 |
for eid, type, source, extid, mtime in cursor.fetchall(): |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
219 |
if type != 'EUser': |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
220 |
print "don't know what to do with entity type", type |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
221 |
continue |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
222 |
if source != 'ldapuser': |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
223 |
print "don't know what to do with source type", source |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
224 |
continue |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
225 |
ldapinfos = dict(x.strip().split('=') for x in extid.split(',')) |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
226 |
login = ldapinfos['uid'] |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
227 |
firstname = ldapinfos['uid'][0].upper() |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
228 |
surname = ldapinfos['uid'][1:].capitalize() |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
229 |
if login != 'jcuissinat': |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
230 |
args = dict(eid=eid, type=type, source=source, login=login, |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
231 |
firstname=firstname, surname=surname, mtime=mtime) |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
232 |
print args |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
233 |
cursor.execute(insert, args) |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
234 |
cursor.execute(update, args) |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
235 |
|
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
236 |
cnx.commit() |
643db91242b1
[doc] Integration of card http://intranet.logilab.fr/intra/card/eid/3355 to the book.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
317
diff
changeset
|
237 |
cnx.close() |
199
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
238 |
|
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
239 |