| Conditions | 2 |
| Total Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | # -*- coding: utf-8 -*- |
||
| 37 | def get_db_handler(): |
||
| 38 | """Get the appropriate db adapter.""" |
||
| 39 | if DB_NAME == 'mongo': |
||
| 40 | client = MongoClient(host=settings.DB_URI, port=settings.DB_PORT) |
||
| 41 | conn = client[settings.DB_NAME] |
||
| 42 | coll = conn[settings.DB_TABLE] |
||
| 43 | return mongo_adapter.Db(client, conn, coll, format_charts) |
||
| 44 | else: |
||
| 45 | raise NotImplementedError( |
||
| 46 | 'Mongodb is the only supported database right now.') |
||
| 47 |