MySQL Forums
Forum List  »  Connector/Python

Re: TypeError( TypeError: Python 'states' cannot be converted to a MySQL type
Posted by: Javier Treviño
Date: September 10, 2024 12:50PM

Hi Rob,
Digging into this a little, I think the Django support is covering enums.
If you test with an older version I think you will see the same error.

I was just trying to determine if you were running into a bug that was introduced in a recent version of the connector, but looking at the code it does not seem like that.

Can you please raise a bug report in https://bugs.mysql.com so we can plan an enhancement to support enums? Just follow the steps in the bug creation, actually all of the information you provided in your initial post is pretty complete, so you can use the same for the bug report.

As a workaround, have you tried using a regular sequence instead of an enum to assign it to the CharField.choices attribute? See https://docs.djangoproject.com/en/3.2/ref/models/fields/#django.db.models.Field.choices.

Best regards.

====================================
Javier Treviño
MySQL on Windows Team

Options: ReplyQuote




Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.