Skip to content

Instantly share code, notes, and snippets.

@Haegin
Created October 3, 2012 08:56
Show Gist options
  • Save Haegin/3825891 to your computer and use it in GitHub Desktop.
Save Haegin/3825891 to your computer and use it in GitHub Desktop.
Cleaner mongo DB integration
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