Opened 8 years ago

Last modified 8 years ago

#27901 closed Bug

Problem with Django & MySQL & model fields returning custom unicode classes — at Initial Version

Reported by: Dominique Barton Owned by: nobody
Component: Database layer (models, ORM) Version: 1.10
Severity: Normal Keywords: mysql, unicode, error
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hi there

I use a custom model field (inherited from TextField) which simply returns its value as an "enhanced" unicode object.
Unfortunately, this will raise UnicodeErrors as MySQLdb apparently fails recognizing those values as unicode. The comparision isn't very clever there ;)

MySQLdb has a use_unicode flag, but I don't know how to implement it in Django and I think this is a serious bug.

I've prepared a whole test case right here: https://github.com/domibarton/django-mysql-unicode-error

I hope this is enough for a "proper" bug description.

Cheers
Domi

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top