redisco icon indicating copy to clipboard operation
redisco copied to clipboard

ListField unicode load error in Model.objects.all() function

Open ScenK opened this issue 12 years ago • 0 comments

class Article(models.Model):
       title = models.Attribute()
       tags = models.ListField(unicode)

 new = Article(title='what ever')
 new.tags = [ u'Niña', u'Niñb' ]
 new.save()

While when load:

Article.objects.all()

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 0: ordinal not in range(128)

In redis-cli:

redis 127.0.0.1:6379> GET "Article:tags:5omv5reh"
(error) ERR Operation against a key holding the wrong kind of value

ScenK avatar Dec 05 '13 07:12 ScenK