author | Sylvain Thénault <sylvain.thenault@logilab.fr> |
Tue, 16 Mar 2010 12:31:06 +0100 | |
branch | stable |
changeset 4909 | a13c1d1ecc5b |
parent 4252 | 6c4f109c2b03 |
child 5421 | 8167de96c523 |
permissions | -rw-r--r-- |
0 | 1 |
# -*- coding: utf-8 -*- |
1977
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
2 |
""" |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
3 |
|
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
4 |
:organization: Logilab |
4212
ab6573088b4a
update copyright: welcome 2010
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1977
diff
changeset
|
5 |
:copyright: 2001-2010 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2. |
1977
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
6 |
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
7 |
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
8 |
""" |
0 | 9 |
import os |
10 |
os.environ["DJANGO_SETTINGS_MODULE"] = 'data.settings' |
|
11 |
||
12 |
from django import template |
|
13 |
||
14 |
||
15 |
def encode_output(self, output): |
|
16 |
# Check type so that we don't run str() on a Unicode object |
|
17 |
if not isinstance(output, basestring): |
|
18 |
return unicode(output) |
|
19 |
return output |
|
20 |
||
21 |
template.VariableNode.encode_output = encode_output |
|
22 |
||
4023
eae23c40627a
drop common subpackage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
23 |
from cubicweb.view import StartupView |
0 | 24 |
|
25 |
INDEX_TEMPLATE = template.Template(u''' |
|
26 |
<h1>hellô {{ user.login }}</h1> |
|
27 |
''') |
|
28 |
||
29 |
class MyIndex(StartupView): |
|
30 |
id = 'index' |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
31 |
|
0 | 32 |
def call(self): |
33 |
ctx = template.Context({'user': self.req.user}) |
|
34 |
return INDEX_TEMPLATE.render(ctx) |