Problem setting PluginManager options

26 views
Skip to first unread message

Alan Etkin

unread,
Mar 9, 2013, 4:59:47 PM3/9/13
to web...@googlegroups.com
I'm trying to test my new plugin by setting some options in db.py, but those values are not preserved by PluginManager when the plugin is initialized at the plugin model. Is it a problem with my code or a PluginManager issue?.

db.py:

# auth.enable_record_versioning(db)

# add this to your app model file
from gluon.tools import PluginManager
plugins
= PluginManager()

# clientapi options

# requests are logged by default. Here we disable them
plugins
.clientapi.log = True

# setup makes the client api download any db scheme
# and set default values. You can call .setup from custom
# JavaScript code.
plugins
.clientapi.setup = True

# a string function name for calling after client setup
# this is a convenient shortcut for handling database
# definitions upon retrieval. This can also be set with
# custom JavaScript.
plugins
.clientapi.onsetup = None

# for other origin requests
plugins
.clientapi.origin = "*"


The plugin model file:

http://code.google.com/p/plugin-clientapi/source/browse/models/plugin_clientapi.py

System info:
web2py trunk Version 2.4.2-stable+timestamp.2013.03.09.00.16.49
Rocket server
Ubuntu 12.04

Thanks

Alan Etkin

unread,
Mar 10, 2013, 2:54:07 PM3/10/13
to web...@googlegroups.com
> Is it a problem with my code or a PluginManager issue?.

Well, it is a problem with my code. I tried a simplified plugin setup following the old recipe (third edition) and it works. There's something illegal about the plugin setup (project code) but I cannot figure it out.

Alan Etkin

unread,
Mar 11, 2013, 10:37:35 AM3/11/13
to web...@googlegroups.com
Well, it is a problem with my code. I tried a simplified plugin setup following the old recipe (third edition) and it works.

I cannot reproduce the problem, after making small changes to my code. I think I was overwriting the plugins variable by calling the PluginManager constructor twice, both in the scaffolding  model and the plugin, and perhaps it was overwriting the customized values.

Reply all
Reply to author
Forward
0 new messages