get_or_create is unable to handle unicode characters
|Reported by:||Dave Naffziger||Owned by:||Malcolm Tredinnick|
|Component:||Database layer (models, ORM)||Version:||master|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||yes|
Description (last modified by )
class Article(models.Model): headline = models.CharField(max_length=100) Shell session: >>> from mysite.models import Article >>> string = u'\xae' >>> a = Article.objects.get_or_create(headline = string) >>> a (<Article: Article object>, True) >>> a = Article.objects.get_or_create(headline = string) >>> a (<Article: Article object>, True)
This seems to be recently introduced (I'm on 8125) and only noticed the bug after a recent update.
This is a pretty major bug and I ran out of time tonight to dig into it, but I wanted to at raise the issue now so that others can look at it.
This is going to create serious backwards incompatibility issues in people's databases if they are running with this bug.
Change History (28)
comment:1 Changed 8 years ago by
|Patch needs improvement:||unset|
|Status:||new → closed|
comment:18 Changed 8 years ago by
|Owner:||changed from nobody to Malcolm Tredinnick|
|Status:||reopened → new|