]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- ouch, this needs to be in dbapi, not module level!
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 19 Dec 2014 23:20:11 +0000 (18:20 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 19 Dec 2014 23:20:11 +0000 (18:20 -0500)
lib/sqlalchemy/dialects/mysql/gaerdbms.py

index b4daec69c14b4a012276ca5e3234da4b7a99485f..284b51bde3b9fb0e9c96d9cba3492d759b7176b9 100644 (file)
@@ -43,13 +43,6 @@ import re
 from sqlalchemy.util import warn_deprecated
 
 
-warn_deprecated(
-    "Google Cloud SQL now recommends creating connections via the "
-    "MySQLdb dialect directly, using the URL format "
-    "mysql+mysqldb://root@/<dbname>?unix_socket=/cloudsql/<projectid>:<instancename>"
-)
-
-
 def _is_dev_environment():
     return os.environ.get('SERVER_SOFTWARE', '').startswith('Development/')
 
@@ -58,6 +51,14 @@ class MySQLDialect_gaerdbms(MySQLDialect_mysqldb):
 
     @classmethod
     def dbapi(cls):
+
+        warn_deprecated(
+            "Google Cloud SQL now recommends creating connections via the "
+            "MySQLdb dialect directly, using the URL format "
+            "mysql+mysqldb://root@/<dbname>?unix_socket=/cloudsql/"
+            "<projectid>:<instancename>"
+        )
+
         # from django:
         # http://code.google.com/p/googleappengine/source/
         #     browse/trunk/python/google/storage/speckle/