author | Aurelien Campeas <aurelien.campeas@logilab.fr> |
Tue, 02 Mar 2010 18:10:03 +0100 | |
branch | stable |
changeset 4748 | 135329e51713 |
parent 2547 | f32af375339d |
child 4936 | a4b772a0d801 |
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 |
|
1715 | 14 |
Why does not CubicWeb have a template language ? |
15 |
------------------------------------------------ |
|
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
16 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
17 |
There are enough template languages out there. You can use your |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
18 |
preferred template language if you want. [explain how to use a |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
19 |
template language] |
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
20 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
21 |
*CubicWeb* does not define its own templating language as this was |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
22 |
not our goal. Based on our experience, we realized that |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
23 |
we could gain productivity by letting designers use design tools |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
24 |
and developpers develop without the use of the templating language |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
25 |
as an intermediary that could not be anyway efficient for both parties. |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
26 |
Python is the templating language that we use in *CubicWeb*, but again, |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
27 |
it does not prevent you from using a templating language. |
337
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
28 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
29 |
The reason template languages are not used in this book is that |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
30 |
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
|
31 |
|
1715 | 32 |
Why do you think using pure python is better than using a template language ? |
33 |
----------------------------------------------------------------------------- |
|
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
34 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
35 |
Python is an Object Oriented Programming language and as such it |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
36 |
already provides a consistent and strong architecture and syntax |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
37 |
a templating language would not reach. |
345
31f88b2e3500
more translation and complements
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
344
diff
changeset
|
38 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
39 |
When doing development, you need a real language and template |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
40 |
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
|
41 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
42 |
Using Python instead of a template langage for describing the user interface |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
43 |
makes it to maintain with real functions/classes/contexts without the need of |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
44 |
learning a new dialect. By using Python, we use standard OOP techniques and |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
45 |
this is a key factor in a robust application. |
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
46 |
|
4748
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
47 |
The `cwtags` (http://www.cubicweb.org/project/cwtags) package can be |
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
48 |
used in cubes to help generate html from Python with more comfort than |
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
49 |
raw strings. |
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
50 |
|
1890
108f3b6584b7
[doc] add faq about reseting password for some user
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
1808
diff
changeset
|
51 |
Why do you use the LGPL license to prevent me from doing X ? |
2173
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
52 |
------------------------------------------------------------ |
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
53 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
54 |
LGPL means that *if* you redistribute your application, you need to |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
55 |
redistribute the changes you made to CubicWeb under the LGPL licence. |
345
31f88b2e3500
more translation and complements
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
344
diff
changeset
|
56 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
57 |
Publishing a web site has nothing to do with redistributing |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
58 |
source code. A fair amount of companies use modified LGPL code |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
59 |
for internal use. And someone could publish a *CubicWeb* component |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
60 |
under a BSD licence for others to plug into a LGPL framework without |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
61 |
any problem. The only thing we are trying to prevent here is someone |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
62 |
taking the framework and packaging it as closed source to his own |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
63 |
clients. |
345
31f88b2e3500
more translation and complements
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
344
diff
changeset
|
64 |
|
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
65 |
|
1715 | 66 |
CubicWeb looks pretty recent. Is it stable ? |
67 |
-------------------------------------------- |
|
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
68 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
69 |
It is constantly evolving, piece by piece. The framework has evolved since |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
70 |
2001 and data has been migrated from one schema to the other ever since. There |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
71 |
is a well-defined way to handle data and schema migration. |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
72 |
|
1715 | 73 |
Why is the RQL query language looking similar to X ? |
74 |
----------------------------------------------------- |
|
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
75 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
76 |
It may remind you of SQL but it is higher level than SQL, more like |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
77 |
SPARQL. Except that SPARQL did not exist when we started the project. |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
78 |
With version 3.4, CubicWeb has support for SPARQL. |
337
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
79 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
80 |
That RQL language is what is going to make a difference with django- |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
81 |
like frameworks for several reasons. |
337
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
82 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
83 |
1. accessing data is *much* easier with it. One can write complex |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
84 |
queries with RQL that would be tedious to define and hard to maintain |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
85 |
using an object/filter suite of method calls. |
337
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
86 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
87 |
2. it offers an abstraction layer allowing your applications to run |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
88 |
on multiple back-ends. That means not only various SQL backends |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
89 |
(postgresql, sqlite, mysql), but also multiple databases at the |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
90 |
same time, and also non-SQL data stores like LDAP directories and |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
91 |
subversion/mercurial repositories (see the `vcsfile` |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
92 |
component). Google App Engine is yet another supported target for |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
93 |
RQL. |
337
eb329d0db467
[doc] FAQ improvements based on posts in forums.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
335
diff
changeset
|
94 |
|
4748
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
95 |
Which ajax library is CubicWeb using ? |
2173
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
96 |
-------------------------------------- |
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
97 |
|
4748
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
98 |
CubicWeb uses jQuery and provides a few helpers on top of |
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
99 |
that. Additionally, some jQuery plugins are provided (some are |
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
100 |
provided in specific cubes). |
1678
67162cb05b4b
[doc] Add FAQ entries based on answers from forum.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
1677
diff
changeset
|
101 |
|
67162cb05b4b
[doc] Add FAQ entries based on answers from forum.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
1677
diff
changeset
|
102 |
|
2173
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
103 |
How is security implemented ? |
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
104 |
------------------------------ |
1678
67162cb05b4b
[doc] Add FAQ entries based on answers from forum.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
1677
diff
changeset
|
105 |
|
4748
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
106 |
The basis for security is a mapping from operations to groups or |
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
107 |
arbitrary RQL expressions. These mappings are scoped to entities and |
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
108 |
relations. |
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
109 |
|
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
110 |
This is an example for an Entity Type definition: |
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
111 |
|
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
112 |
.. sourcecode:: python |
1678
67162cb05b4b
[doc] Add FAQ entries based on answers from forum.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
1677
diff
changeset
|
113 |
|
67162cb05b4b
[doc] Add FAQ entries based on answers from forum.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
1677
diff
changeset
|
114 |
class Version(EntityType): |
2173
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
115 |
"""a version is defining the content of a particular project's |
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
116 |
release""" |
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
117 |
# definition of attributes is voluntarily missing |
4748
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
118 |
__permissions__ = {'read': ('managers', 'users', 'guests',), |
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
119 |
'update': ('managers', 'logilab', 'owners'), |
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
120 |
'delete': ('managers',), |
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
121 |
'add': ('managers', 'logilab', |
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
122 |
ERQLExpression('X version_of PROJ, U in_group G, ' |
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
123 |
'PROJ require_permission P, ' |
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
124 |
'P name "add_version", P require_group G'),)} |
1678
67162cb05b4b
[doc] Add FAQ entries based on answers from forum.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
1677
diff
changeset
|
125 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
126 |
The above means that permission to read a Version is granted to any |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
127 |
user that is part of one of the groups 'managers', 'users', 'guests'. |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
128 |
The 'add' permission is granted to users in group 'managers' or |
4748
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
129 |
'logilab' or to users in group G, if G is linked by a permission |
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
130 |
entity named "add_version" to the version's project. |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
131 |
|
4748
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
132 |
An example for a Relation Definition (RelationType both defines a |
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
133 |
relation type and implicitly one relation definition, on which the |
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
134 |
permissions actually apply): |
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
135 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
136 |
.. sourcecode:: python |
1678
67162cb05b4b
[doc] Add FAQ entries based on answers from forum.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
1677
diff
changeset
|
137 |
|
67162cb05b4b
[doc] Add FAQ entries based on answers from forum.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
1677
diff
changeset
|
138 |
class version_of(RelationType): |
67162cb05b4b
[doc] Add FAQ entries based on answers from forum.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
1677
diff
changeset
|
139 |
"""link a version to its project. A version is necessarily linked |
67162cb05b4b
[doc] Add FAQ entries based on answers from forum.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
1677
diff
changeset
|
140 |
to one and only one project. """ |
67162cb05b4b
[doc] Add FAQ entries based on answers from forum.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
1677
diff
changeset
|
141 |
# some lines voluntarily missing |
4748
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
142 |
__permissions__ = {'read': ('managers', 'users', 'guests',), |
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
143 |
'delete': ('managers', ), |
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
144 |
'add': ('managers', 'logilab', |
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
145 |
RRQLExpression('O require_permission P, P name "add_version", ' |
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
146 |
'U in_group G, P require_group G'),) } |
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
147 |
|
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
148 |
The main difference lies in the basic available operations (there is |
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
149 |
no 'update' operation) and the usage of an RRQLExpression (rql |
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
150 |
expression for a relation) instead of an ERQLExpression (rql |
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
151 |
expression for an entity). |
1678
67162cb05b4b
[doc] Add FAQ entries based on answers from forum.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
1677
diff
changeset
|
152 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
153 |
You can find additional information in the section :ref:`security`. |
1678
67162cb05b4b
[doc] Add FAQ entries based on answers from forum.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
1677
diff
changeset
|
154 |
|
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
155 |
|
2173
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
156 |
What is `Error while publishing rest text ...` ? |
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
157 |
------------------------------------------------ |
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
158 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
159 |
While modifying the description of an entity, you get an error message in |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
160 |
the instance `Error while publishing ...` for Rest text and plain text. |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
161 |
The server returns a traceback like as follows :: |
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
162 |
|
1191
216141cf47a3
remove all erudi and ginco occurences in the doc
Emile Anclin <emile.anclin@logilab.fr>
parents:
383
diff
changeset
|
163 |
2008-10-06 15:05:08 - (cubicweb.rest) ERROR: error while publishing ReST text |
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
164 |
Traceback (most recent call last): |
1191
216141cf47a3
remove all erudi and ginco occurences in the doc
Emile Anclin <emile.anclin@logilab.fr>
parents:
383
diff
changeset
|
165 |
File "/home/user/src/blogdemo/cubicweb/common/rest.py", line 217, in rest_publish |
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
166 |
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
|
167 |
file = __builtin__.open(filename, mode, buffering) |
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
168 |
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
|
169 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
170 |
This can be fixed by applying the patch described in : |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
171 |
http://code.google.com/p/googleappengine/issues/detail?id=48 |
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
113
diff
changeset
|
172 |
|
2173
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
173 |
What are hooks used for ? |
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
174 |
------------------------- |
345
31f88b2e3500
more translation and complements
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
344
diff
changeset
|
175 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
176 |
Hooks are executed around (actually before or after) events. The |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
177 |
most common events are data creation, update and deletion. They |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
178 |
permit additional constraint checking (those not expressible at the |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
179 |
schema level), pre and post computations depending on data |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
180 |
movements. |
345
31f88b2e3500
more translation and complements
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
344
diff
changeset
|
181 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
182 |
As such, they are a vital part of the framework. |
345
31f88b2e3500
more translation and complements
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
344
diff
changeset
|
183 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
184 |
Other kinds of hooks, called Operations, are available |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
185 |
for execution just before commit. |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
186 |
|
2173
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
187 |
When should you define an HTML template rather than define a graphical component ? |
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
188 |
---------------------------------------------------------------------------------- |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
189 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
190 |
An HTML template cannot contain code, hence it is only about static |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
191 |
content. A component is made of code and operations that apply on a |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
192 |
well defined context (request, result set). It enables much more |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
193 |
dynamic views. |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
194 |
|
1715 | 195 |
What is the difference between `AppRsetObject` and `AppObject` ? |
196 |
---------------------------------------------------------------- |
|
199
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
197 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
198 |
`AppRsetObject` instances are selected on a request and a result |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
199 |
set. `AppObject` instances are directly selected by id. |
199
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
200 |
|
2173
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
201 |
How to update a database after a schema modification ? |
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
202 |
------------------------------------------------------ |
345
31f88b2e3500
more translation and complements
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
344
diff
changeset
|
203 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
204 |
It depends on what has been modified in the schema. |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
205 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
206 |
* Update the permissions and properties of an entity or a relation: |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
207 |
``sync_schema_props_perms('MyEntityOrRelation')``. |
1350
31e4c8d30e5d
[doc] Adds how to add attribute in DB.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
1348
diff
changeset
|
208 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
209 |
* Add an attribute: ``add_attribute('MyEntityType', 'myattr')``. |
1350
31e4c8d30e5d
[doc] Adds how to add attribute in DB.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
1348
diff
changeset
|
210 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
211 |
* Add a relation: ``add_relation_definition('SubjRelation', 'MyRelation', 'ObjRelation')``. |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
212 |
|
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
213 |
|
2173
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
214 |
How to create an anonymous user ? |
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
215 |
--------------------------------- |
345
31f88b2e3500
more translation and complements
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
344
diff
changeset
|
216 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
217 |
This allows to bypass authentication for your site. In the |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
218 |
``all-in-one.conf`` file of your instance, define the anonymous user |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
219 |
as follows :: |
345
31f88b2e3500
more translation and complements
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
344
diff
changeset
|
220 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
221 |
# login of the CubicWeb user account to use for anonymous user (if you want to |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
222 |
# allow anonymous) |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
223 |
anonymous-user=anon |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
224 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
225 |
# password of the CubicWeb user account matching login |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
226 |
anonymous-password=anon |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
227 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
228 |
You also must ensure that this `anon` user is a registered user of |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
229 |
the DB backend. If not, you can create through the administation |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
230 |
interface of your instance by adding a user with the role `guests`. |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
231 |
This could be the admin account (for development |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
232 |
purposes, of course). |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
233 |
|
1348
28bb9efe0cc8
[doc] Add information on anonymous user configuration.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
1191
diff
changeset
|
234 |
.. note:: |
28bb9efe0cc8
[doc] Add information on anonymous user configuration.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
1191
diff
changeset
|
235 |
While creating a new instance, you can decide to allow access |
1378
3645800647ef
[doc] Fix typo.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
1354
diff
changeset
|
236 |
to anonymous user, which will automatically execute what is |
1348
28bb9efe0cc8
[doc] Add information on anonymous user configuration.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
1191
diff
changeset
|
237 |
decribed above. |
28bb9efe0cc8
[doc] Add information on anonymous user configuration.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
1191
diff
changeset
|
238 |
|
199
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
239 |
|
2476
1294a6bdf3bf
application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2317
diff
changeset
|
240 |
How to change the instance logo ? |
2173
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
241 |
------------------------------------ |
345
31f88b2e3500
more translation and complements
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
344
diff
changeset
|
242 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
243 |
There are two ways of changing the logo. |
199
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
244 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
245 |
1. The easiest way to use a different logo is to replace the existing |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
246 |
``logo.png`` in ``myapp/data`` by your prefered icon and refresh. |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
247 |
By default all instance will look for a ``logo.png`` to be |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
248 |
rendered in the logo section. |
93
9c919a47e140
[doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
249 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
250 |
.. 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
|
251 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
252 |
2. In your cube directory, you can specify which file to use for the logo. |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
253 |
This is configurable in ``mycube/data/external_resources``: :: |
345
31f88b2e3500
more translation and complements
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
344
diff
changeset
|
254 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
255 |
LOGO = DATADIR/path/to/mylogo.gif |
199
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
256 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
257 |
where DATADIR is ``mycube/data``. |
199
c603087373cd
[doc] Inserted content from LAX book about templates.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
127
diff
changeset
|
258 |
|
1808 | 259 |
|
2173
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
260 |
How to configure a LDAP source ? |
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
261 |
-------------------------------- |
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
|
262 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
263 |
Your instance's sources are defined in ``/etc/cubicweb.d/myapp/sources``. |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
264 |
Configuring an LDAP source is about declaring that source in your |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
265 |
instance configuration file such as: :: |
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
|
266 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
267 |
[ldapuser] |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
268 |
adapter=ldapuser |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
269 |
# ldap host |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
270 |
host=myhost |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
271 |
# base DN to lookup for usres |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
272 |
user-base-dn=ou=People,dc=mydomain,dc=fr |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
273 |
# user search scope |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
274 |
user-scope=ONELEVEL |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
275 |
# classes of user |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
276 |
user-classes=top,posixAccount |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
277 |
# attribute used as login on authentication |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
278 |
user-login-attr=uid |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
279 |
# name of a group in which ldap users will be by default |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
280 |
user-default-group=users |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
281 |
# map from ldap user attributes to cubicweb attributes |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
282 |
user-attrs-map=gecos:email,uid:login |
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
|
283 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
284 |
Any change applied to configuration file requires to restart your |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
285 |
instance. |
383
66804d97b919
[FAQ] debugging selectors : a new faq entry
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
358
diff
changeset
|
286 |
|
4748
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
287 |
You can find additional information in the section :ref:`LDAP`. |
135329e51713
[book/faq] cleanup & complete a bit
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2547
diff
changeset
|
288 |
|
2173
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
289 |
I get NoSelectableObject exceptions, how do I debug selectors ? |
1715 | 290 |
--------------------------------------------------------------- |
383
66804d97b919
[FAQ] debugging selectors : a new faq entry
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
358
diff
changeset
|
291 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
292 |
You just need to put the appropriate context manager around view/component |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
293 |
selection (one standard place in in vreg.py): |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
294 |
|
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
295 |
.. sourcecode:: python |
2041
296e897ab8e1
be more precise & helpful
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
1900
diff
changeset
|
296 |
|
296e897ab8e1
be more precise & helpful
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
1900
diff
changeset
|
297 |
def possible_objects(self, registry, *args, **kwargs): |
296e897ab8e1
be more precise & helpful
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
1900
diff
changeset
|
298 |
"""return an iterator on possible objects in a registry for this result set |
383
66804d97b919
[FAQ] debugging selectors : a new faq entry
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
358
diff
changeset
|
299 |
|
2041
296e897ab8e1
be more precise & helpful
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
1900
diff
changeset
|
300 |
actions returned are classes, not instances |
296e897ab8e1
be more precise & helpful
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
1900
diff
changeset
|
301 |
""" |
296e897ab8e1
be more precise & helpful
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
1900
diff
changeset
|
302 |
from cubicweb.selectors import traced_selection |
296e897ab8e1
be more precise & helpful
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
1900
diff
changeset
|
303 |
with traced_selection(): |
296e897ab8e1
be more precise & helpful
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
1900
diff
changeset
|
304 |
for vobjects in self.registry(registry).values(): |
296e897ab8e1
be more precise & helpful
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
1900
diff
changeset
|
305 |
try: |
296e897ab8e1
be more precise & helpful
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
1900
diff
changeset
|
306 |
yield self.select(vobjects, *args, **kwargs) |
296e897ab8e1
be more precise & helpful
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
1900
diff
changeset
|
307 |
except NoSelectableObject: |
296e897ab8e1
be more precise & helpful
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
1900
diff
changeset
|
308 |
continue |
383
66804d97b919
[FAQ] debugging selectors : a new faq entry
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
358
diff
changeset
|
309 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
310 |
Don't forget the 'from __future__ import with_statement' at the module |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
311 |
top-level. |
2041
296e897ab8e1
be more precise & helpful
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
1900
diff
changeset
|
312 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
313 |
This will yield additional WARNINGs, like this:: |
383
66804d97b919
[FAQ] debugging selectors : a new faq entry
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
358
diff
changeset
|
314 |
|
66804d97b919
[FAQ] debugging selectors : a new faq entry
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
358
diff
changeset
|
315 |
2009-01-09 16:43:52 - (cubicweb.selectors) WARNING: selector one_line_rset returned 0 for <class 'cubicweb.web.views.basecomponents.WFHistoryVComponent'> |
1354
e71f704aaf40
[doc] Adds HowTo format date.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
1350
diff
changeset
|
316 |
|
2173
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
317 |
How to format an entity date attribute ? |
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
318 |
---------------------------------------- |
1354
e71f704aaf40
[doc] Adds HowTo format date.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
1350
diff
changeset
|
319 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
320 |
If your schema has an attribute of type Date or Datetime, you might |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
321 |
want to format it. First, you should define your preferred format using |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
322 |
the site configuration panel ``http://appurl/view?vid=systempropertiesform`` |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
323 |
and then set ``ui.date`` and/or ``ui.datetime``. |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
324 |
Then in the view code, use: |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
325 |
|
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
326 |
.. sourcecode:: python |
2172
cf8f9180e63e
delete-trailing-whitespace
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2041
diff
changeset
|
327 |
|
1354
e71f704aaf40
[doc] Adds HowTo format date.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
1350
diff
changeset
|
328 |
self.format_date(entity.date_attribute) |
1599
38a1d0f190e2
[doc] add FAQ about kerberos auth with postgresql
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
1440
diff
changeset
|
329 |
|
1715 | 330 |
Can PostgreSQL and CubicWeb authentication work with kerberos ? |
331 |
---------------------------------------------------------------- |
|
1599
38a1d0f190e2
[doc] add FAQ about kerberos auth with postgresql
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
1440
diff
changeset
|
332 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
333 |
If you have PostgreSQL set up to accept kerberos authentication, you can set |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
334 |
the db-host, db-name and db-user parameters in the `sources` configuration |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
335 |
file while leaving the password blank. It should be enough for your |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
336 |
instance to connect to postgresql with a kerberos ticket. |
1715 | 337 |
|
2172
cf8f9180e63e
delete-trailing-whitespace
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2041
diff
changeset
|
338 |
|
2173
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
339 |
How to load data from a script ? |
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
340 |
-------------------------------- |
1715 | 341 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
342 |
The following script aims at loading data within a script assuming pyro-nsd is |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
343 |
running and your instance is configured with ``pyro-server=yes``, otherwise |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
344 |
you would not be able to use dbapi. |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
345 |
|
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
346 |
.. sourcecode:: python |
1715 | 347 |
|
348 |
from cubicweb import dbapi |
|
349 |
||
350 |
cnx = dbapi.connection(database='instance-id', user='admin', password='admin') |
|
351 |
cur = cnx.cursor() |
|
352 |
for name in ('Personal', 'Professional', 'Computers'): |
|
353 |
cur.execute('INSERT Blog B: B name %s', name) |
|
354 |
cnx.commit() |
|
355 |
||
2173
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
356 |
What is the CubicWeb datatype corresponding to GAE datastore's UserProperty ? |
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
357 |
----------------------------------------------------------------------------- |
1715 | 358 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
359 |
If you take a look at your instance schema and |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
360 |
click on "display detailed view of metadata" you will see that there |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
361 |
is a Euser entity in there. That's the one that is modeling users. The |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
362 |
thing that corresponds to a UserProperty is a relationship between |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
363 |
your entity and the Euser entity. As in: |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
364 |
|
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
365 |
.. sourcecode:: python |
1715 | 366 |
|
367 |
class TodoItem(EntityType): |
|
368 |
text = String() |
|
369 |
todo_by = SubjectRelation('Euser') |
|
370 |
||
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
371 |
[XXX check that cw handle users better by mapping Google Accounts to local Euser |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
372 |
entities automatically] |
1715 | 373 |
|
1890
108f3b6584b7
[doc] add faq about reseting password for some user
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
1808
diff
changeset
|
374 |
|
2173
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
375 |
How to reset the password for user joe ? |
7fae9300b9f9
[doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2172
diff
changeset
|
376 |
---------------------------------------- |
1890
108f3b6584b7
[doc] add faq about reseting password for some user
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
1808
diff
changeset
|
377 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
378 |
If you want to reset the admin password for ``myinstance``, do:: |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
379 |
|
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
380 |
$ cubicweb-ctl reset-admin-pwd myinstance |
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
381 |
|
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
382 |
You need to generate a new encrypted password:: |
1890
108f3b6584b7
[doc] add faq about reseting password for some user
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
1808
diff
changeset
|
383 |
|
108f3b6584b7
[doc] add faq about reseting password for some user
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
1808
diff
changeset
|
384 |
$ python |
108f3b6584b7
[doc] add faq about reseting password for some user
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
1808
diff
changeset
|
385 |
>>> from cubicweb.server.utils import crypt_password |
108f3b6584b7
[doc] add faq about reseting password for some user
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
1808
diff
changeset
|
386 |
>>> crypt_password('joepass') |
108f3b6584b7
[doc] add faq about reseting password for some user
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
1808
diff
changeset
|
387 |
'qHO8282QN5Utg' |
2172
cf8f9180e63e
delete-trailing-whitespace
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2041
diff
changeset
|
388 |
>>> |
1890
108f3b6584b7
[doc] add faq about reseting password for some user
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
1808
diff
changeset
|
389 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
390 |
and paste it in the database:: |
1890
108f3b6584b7
[doc] add faq about reseting password for some user
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
1808
diff
changeset
|
391 |
|
108f3b6584b7
[doc] add faq about reseting password for some user
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
1808
diff
changeset
|
392 |
$ psql mydb |
108f3b6584b7
[doc] add faq about reseting password for some user
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
1808
diff
changeset
|
393 |
mydb=> update cw_cwuser set cw_upassword='qHO8282QN5Utg' where cw_login='joe'; |
2041
296e897ab8e1
be more precise & helpful
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
1900
diff
changeset
|
394 |
UPDATE 1 |
2316
234475d6ed7b
added entry about bad user account
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
2175
diff
changeset
|
395 |
|
234475d6ed7b
added entry about bad user account
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
2175
diff
changeset
|
396 |
I've just created a user in a group and it doesn't work ! |
234475d6ed7b
added entry about bad user account
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
2175
diff
changeset
|
397 |
--------------------------------------------------------- |
234475d6ed7b
added entry about bad user account
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
2175
diff
changeset
|
398 |
|
234475d6ed7b
added entry about bad user account
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
2175
diff
changeset
|
399 |
You are probably getting errors such as :: |
234475d6ed7b
added entry about bad user account
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
2175
diff
changeset
|
400 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
401 |
remove {'PR': 'Project', 'C': 'CWUser'} from solutions since your_user has no read access to cost |
2316
234475d6ed7b
added entry about bad user account
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
2175
diff
changeset
|
402 |
|
2547
f32af375339d
[doc] fix FAQ layout
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2535
diff
changeset
|
403 |
This is because you have to put your user in the "users" group. The user has to be in both groups. |