# NOTE this plugin_uuid thing might occur in js files, ** do not rename **
js_env = { 'plugin_uuid' : self.domid }
js_env.update (self._settings)
+ for k in self.exclude_from_json():
+ if k in js_env: del js_env[k]
settings_json = json.dumps (js_env, separators=(',',':'))
env ['settings_json' ] = settings_json
# compute plugin-specific initialization
# 'css_chunk': [], # likewise for css scripts
# }
+ # for better performance
+ # you can specify a list of keys that won't be exposed as json attributes
+ def exclude_from_json (self): return []
Plugin.__init__ (self, **settings)
self.list=list
# don't expose this as it's big and
-# self.add_to_settings ('list')
+ self.add_to_settings ('list')
self.with_datatables = with_datatables
self.add_to_settings ('with_datatables')
# for tests
# 'js_chunks' : "/* a javascript chunk */",
# 'css_chunks': "/* a css style */ ",
+
+ def exclude_from_json (self):
+ return ['list']