Created
October 3, 2012 08:56
-
-
Save Haegin/3825891 to your computer and use it in GitHub Desktop.
Cleaner mongo DB integration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Plugin: | |
.... | |
PLUGIN_DEPENDS = [...] | |
# not sure what this decorator does yet so I'll just leave it here | |
#@Plugin.integrate_with('mongodb') | |
def _get_db(self, mongodb): | |
if 'mongodb' in PLUGIN_DEPENDS | |
self.db = mongodb.get_db(self.plugin_name()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment