Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubicweb
Commits
493f527aed1e
Commit
ae4717f0
authored
Aug 11, 2009
by
Nicolas Chauvat
Browse files
backport stable branch
parents
1ba89b590d0c
4e1ad9d6a3e7
Changes
5
Hide whitespace changes
Inline
Side-by-side
server/session.py
View file @
493f527a
...
...
@@ -114,8 +114,9 @@ class Session(RequestSessionMixIn):
if
rcache
is
not
None
:
rset
,
entities
=
rcache
rset
.
rows
.
append
([
targeteid
])
if
isinstance
(
rset
.
description
,
list
):
# else description not set
rset
.
description
.
append
([
self
.
describe
(
targeteid
)[
0
]])
if
not
isinstance
(
rset
.
description
,
list
):
# else description not set
rset
.
description
=
list
(
rset
.
description
)
rset
.
description
.
append
([
self
.
describe
(
targeteid
)[
0
]])
rset
.
rowcount
+=
1
targetentity
=
self
.
entity_from_eid
(
targeteid
)
entities
.
append
(
targetentity
)
...
...
web/test/unittest_urlrewrite.py
View file @
493f527a
...
...
@@ -29,6 +29,8 @@ class UrlRewriteTC(TestCase):
self
.
assertListEquals
(
rules
,
[
(
'foo'
,
dict
(
rql
=
'Foo F'
)),
(
'/index'
,
dict
(
vid
=
'index2'
)),
(
'/_'
,
dict
(
vid
=
'manage'
)),
(
'/_registry'
,
dict
(
vid
=
'registry'
)),
(
'/schema'
,
dict
(
vid
=
'schema'
)),
(
'/myprefs'
,
dict
(
vid
=
'propertiesform'
)),
(
'/siteconfig'
,
dict
(
vid
=
'systempropertiesform'
)),
...
...
web/test/unittest_viewselector.py
View file @
493f527a
...
...
@@ -74,6 +74,7 @@ class VRegistryTC(ViewSelectorTC):
(
'manage'
,
startup
.
ManageView
),
(
'owl'
,
owl
.
OWLView
),
(
'propertiesform'
,
cwproperties
.
CWPropertiesForm
),
(
'registry'
,
startup
.
RegistryView
),
(
'schema'
,
schema
.
SchemaView
),
(
'systempropertiesform'
,
cwproperties
.
SystemCWPropertiesForm
)])
...
...
web/views/autoform.py
View file @
493f527a
...
...
@@ -25,6 +25,8 @@ class AutomaticEntityForm(forms.EntityFieldsForm):
* rtags (rcategories, rfields, rwidgets, inlined, rpermissions)
* various standard form parameters
XXX s/rtags/uicfg/ ?
You can also easily customise it by adding/removing fields in
AutomaticEntityForm instances.
"""
...
...
web/views/startup.py
View file @
493f527a
...
...
@@ -160,16 +160,21 @@ class IndexView(ManageView):
class
RegistryView
(
StartupView
):
id
=
'registry'
title
=
_
(
'registry'
)
__select__
=
match_user_groups
(
'managers'
)
__select__
=
StartupView
.
__select__
&
match_user_groups
(
'managers'
)
def
call
(
self
,
**
kwargs
):
"""The default view representing the instance's management"""
self
.
w
(
u
'<h1>%s</h1>'
%
_
(
"Registry's content"
))
keys
=
sorted
(
self
.
vreg
)
self
.
w
(
u
'<p>%s</p>'
%
' - '
.
join
(
'<a href="/_registry#%s">%s</a>'
%
(
key
,
key
)
for
key
in
keys
))
self
.
w
(
u
'<p>%s</p>
\n
'
%
' - '
.
join
(
'<a href="/_registry#%s">%s</a>'
%
(
key
,
key
)
for
key
in
keys
))
for
key
in
keys
:
self
.
w
(
u
'<h2><a name="%s">%s</a></h2><table>'
%
(
key
,
key
))
for
key
,
value
in
sorted
(
self
.
vreg
[
key
].
items
()):
self
.
w
(
u
'<tr><td>%s</td><td>%s</td></tr>'
%
(
key
,
xml_escape
(
repr
(
value
))))
self
.
w
(
u
'</table>'
)
self
.
w
(
u
'<h2><a name="%s">%s</a></h2>'
%
(
key
,
key
))
items
=
self
.
vreg
[
key
].
items
()
if
items
:
self
.
w
(
u
'<table><tbody>'
)
for
key
,
value
in
sorted
(
items
):
self
.
w
(
u
'<tr><td>%s</td><td>%s</td></tr>'
%
(
key
,
xml_escape
(
repr
(
value
))))
self
.
w
(
u
'</tbody></table>
\n
'
)
else
:
self
.
w
(
u
'<p>Empty</p>
\n
'
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment