Commits

danjac  committed a87583b

default->simple

  • Participants
  • Parent commits 275dee4

Comments (0)

Files changed (3)

File flaskext/adapters.py

 from sqlalchemy import create_engine
 from sqlalchemy.orm import create_session
 
-class DefaultAdapter(object):
+class SimpleAdapter(object):
     """
     Simple SQLAlchemy adapter. Assumes a single engine attached to the session.
 

File flaskext/alchemy.py

 
 from flask import current_app
 
-from flaskext.alchemy.adapters import DefaultAdapter
+from adapters import SimpleAdapter
 
 db_session = scoped_session(lambda: current_app.sql_adapter.create_session())
 
 def init_alchemy(app, adapter_cls=None, **adapter_kwargs):
     """
     Creates an instance of a SQLAlchemy adapter. By default uses the 
-    flaskext.alchemy.DefaultAdapter class.
+    flaskext.alchemy.SimpleAdapter class.
 
     The adapter is appended to the application instance as "sql_adapter". 
 
     """
 
     if adapter_cls is None:
-        adapter_cls = DefaultAdapter
+        adapter_cls = SimpleAdapter
 
     app.sql_adapter = adapter_cls(app, **adapter_kwargs)
 
 from sqlalchemy.exc import OperationalError
 
 from flask import Flask, Response
-from flaskext.alchemy import init_alchemy, db_session, Base, DefaultAdapter, \
+from flaskext.alchemy import init_alchemy, db_session, Base, SimpleAdapter, \
     create_all, drop_all
 
 class TestCase(unittest.TestCase):
 
         adapter = init_alchemy(self.app)
         
-        assert isinstance(adapter, DefaultAdapter)
+        assert isinstance(adapter, SimpleAdapter)
         
         assert not self.app.sql_adapter.autocommit
         assert not self.app.sql_adapter.autoflush
     
     def test_init_alchemy_another_adapter(self):
         
-        class DummyAdapter(DefaultAdapter):
+        class DummyAdapter(SimpleAdapter):
 
             def __init__(self, app):