Opened 16 years ago
Closed 16 years ago
#7612 closed (worksforme)
ORM isn't finding Unicode names with special characters with MySQL and UTF8 tables
Reported by: | mattdennewitz | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Keywords: | mysql unicode orm | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Django's ORM doesn't seem to be able to select records by a field w/ special characters in the criteria. For example: it's properly inserted a record who's unicode "name" property has a cedilla, but when looking up the record w/ the same unicode "name" variable it used to insert, the ORM raises DoesNotExist.
Im using MySQL 5 w/ UTF8 tables and unicode collation and Django svn rev. 7826 on OSX Leopard
Change History (2)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Django's got plenty of regression tests that ensure it works correctly with Unicode data (see tests/modeltests/basic
just for a few), so this is likely something going on in your code. For example, if you're using Unicode literals in your code and haven't properly declared the source file's encoding you could get errors just like this.
I'm closing this ticket "worksforme" since Unicode data has worked in Django for many, many others. Please reopen with more details if you're convinced it's a Django bug, but please first look into what it could be in your code since that's probably where the problem lies.
These are the last two queries executed before the time of death: