MySQL Connector/Python v1.1.1 alpha: With Pooling and Django!

Connector/Python v1.1.1 is available for testing. It’s the second of a series of alpha releases which will bring some new features. Check out the Change History if you want to keep up with what is being added and changed.

Notable changes for v1.1.1:

Connector/Python v1.1.1 is alpha and although in good shape, it’s advised not to use it in production just yet.

Some useful links:

Comments

AC
Nice, this means that there will finally be a stable way of using Python 3 + Django + MySQL.
Antonio Martínez

I have just tried to use it on Django, but I get the following error:

AttributeError: ‘str’ object has no attribute ‘decode’

I just run the example on Django tutorial to connect to MySQL

I have Django 1.5.2 and PHP 3.3

¿Any ideas how to solve it?

Antonio Martínez

I have just fixed it in a pragmatic way.

I went to the line 278 function “last_executed_query” and instead of returning the statement decoded, I returned itself.

According to the documentation the str are already unicode in Python 3.x.

After this all the tables were created.

Please, tell me if this fix has sense to you or is a complete disaster.

Sorry for the noise and thanks so much for your work and effort.

Geert Vanderkelen
@Antonio: totally correct fix. I know already what went wrong. If you want, open a Bug at bugs.mysql.com and suggest the fix. Thanks for checking it out!
Pablo Bargues
Hi Geert, thanks for your work, it finally enabled me to use Django on Python 3! Due to django’s last version, 1.6 from one or two weeks ago, I have found the need for another fix for the error: “TypeError: sql_for_inline_foreign_key_references() takes 4 positional arguments but 5 were given” (only for this django version, not the older ones): The file “/mysql/connector/django/creation.py” has the function sql_for_inline_foreign_key_references(self, field, known_models, style) which needs another parameter, leaving it like: sql_for_inline_foreign_key_references(self, model, field, known_models, style) I hope this can help you and others.
Beverly Block

I’m also getting the “TypeError: sql_for_inline_foreign_key_references() takes 4 positional arguments but 5 were given” with Django 1.6.1. Has there really been no fix to this in over 2 months? I asked about it on Stack Overflow, but got no useful response, and I’m stuck with beta testing now several weeks late.

Removing all foreign keys is, obviously, not a feasible workaround…

Beverly Block
Geert Vanderkelen
Yes, there is a fix coming with next release.