from config import config

class BackendNotRecognizedException(Exception):
    """Possible backends are "sqlalchemy", "elasticsearch", and "djangoorm"""""
    pass

if  config['backend'] == 'sqlalchemy':
    from sqlalchemywrapper.sqlalchemywrapper import SqlAlchemyWrapper as Backend
elif config['backend'] == 'elasticsearch':
    from elasticsearchwrapper import ElasticSearchWrapper as Backend
elif config['backend'] == 'djangoorm':
    from djangoormwrapper import DjangoOrmWrapper as Backend
else:
    raise BackendNotRecognizedException

from spicedham.config import config

from sqlalchemywrapper import SqlAlchemyWrapper
#from elasticsearchwrapper import ElasticSearchWrapper
#from djangoormwrapper import DjangoOrmWrapper


class BackendNotRecognizedException(Exception):
    """Possible backends are "sqlalchemy", "elasticsearch", and "djangoorm"""""
    pass

if  config['backend'] == 'sqlalchemy':
    Backend = SqlAlchemyWrapper()
elif config['backend'] == 'elasticsearch':
    Backend = ElasticSearchWrapper()
elif config['backend'] == 'djangoorm':
    Backend = DjangoOrmWrapper()
else:
    raise BackendNotRecognizedException

Fix imports and duck typing
Fix imports and duck typing

* Always import all backends
* Only assign the right one to Backend based off the config
* Fix the config import
