Commit ae4717f0 authored by Nicolas Chauvat's avatar Nicolas Chauvat
Browse files

backport stable branch

......@@ -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)
......
......@@ -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')),
......
......@@ -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)])
......
......@@ -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.
"""
......
......@@ -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')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment