changeset 4857:85c15a83b7f2

Groups2009: Configuration snippets for dicts.
author Dmitrijs Milajevs <dimazest@gmail.com>
date Fri, 17 Jul 2009 12:40:57 +0200
parents b8a22aa1854c
children 2c31e088e849
files wiki/config/more_samples/dicts_wikiconfig_snippet
diffstat 1 files changed, 27 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wiki/config/more_samples/dicts_wikiconfig_snippet	Fri Jul 17 12:40:57 2009 +0200
@@ -0,0 +1,27 @@
+    # This is a sample configuration snippet that shows moin's dicts configuration
+    # See HelpOnConfiguration for more info.
+
+    # The wiki_dicts backend is used by default.
+    def dict_manager_init(self, request):
+        from MoinMoin.datastruct import WikiDicts
+        return WikiDicts(request)
+
+    # Use only dicts defined in the configuration file.
+    def dict_manager_init(self, request):
+        from MoinMoin.datastruct import ConfigDicts
+        dicts = {u'OneDict': {u'first_key': u'first item',
+                              u'second_key': u'second item'},
+                 u'NumbersDict': {u'1': 'One',
+                                  u'2': 'Two'}}
+        return ConfigDicts(request, dicts)
+
+    # Use both config_dicts and wiki_dicts backends.
+    def dict_manager_init(self, request):
+        from MoinMoin.datastruct import ConfigDicts, WikiDicts, CompositeDicts
+        dicts = {u'OneDict': {u'first_key': u'first item',
+                              u'second_key': u'second item'},
+                 u'NumbersDict': {u'1': 'One',
+                                  u'2': 'Two'}}
+        return CompositeDicts(request,
+                              ConfigDicts(request, dicts),
+                              WikiDicts(request))