Commits

Armin Ronacher committed d135da6

Use unicode in SQLAlchemy pattern.

Comments (0)

Files changed (1)

docs/patterns/sqlalchemy.rst

     from sqlalchemy.orm import scoped_session, sessionmaker
     from sqlalchemy.ext.declarative import declarative_base
 
-    engine = create_engine('sqlite:////tmp/test.db')
+    engine = create_engine('sqlite:////tmp/test.db', convert_unicode=True)
     db_session = scoped_session(sessionmaker(autocommit=False,
                                              autoflush=False,
                                              bind=engine)) 
     from sqlalchemy import create_engine, MetaData
     from sqlalchemy.orm import scoped_session, sessionmaker
 
-    engine = create_engine('sqlite:////tmp/test.db')
+    engine = create_engine('sqlite:////tmp/test.db', convert_unicode=True)
     metadata = MetaData()
     db_session = scoped_session(sessionmaker(autocommit=False,
                                              autoflush=False,
 
     from sqlalchemy import create_engine, MetaData
 
-    engine = create_engine('sqlite:////tmp/test.db')
+    engine = create_engine('sqlite:////tmp/test.db', convert_unicode=True)
     metadata = MetaData(bind=engine)
 
 Then you can either declare the tables in your code like in the examples