redisco icon indicating copy to clipboard operation
redisco copied to clipboard

unicode attributes / keys

Open dmk23 opened this issue 12 years ago • 4 comments

Throughout the entire code base redisco requires that keys and indexed attributes be unicode.

This makes absolutely no sense since Redis supports any binary strings and redisco cannot be used to store / index binary data without unnecessary encoding overhead.

The suggestion is to purge unicode requirements from every place in the code base.

dmk23 avatar Oct 10 '12 08:10 dmk23

Any suggestions on how to audit the codebase for this, and what unicode strategy to use (especially WRT python3, where things like CharField probably should be unicode, it probably makes sense in a couple of other places too) ?

stuaxo avatar May 17 '16 09:05 stuaxo

I am not sure that this request is in the scope of an ORM based on Redis. Any specific cases where developers need to store data in binary format ?

kiddouk avatar May 17 '16 13:05 kiddouk

It's easy enough to think of something like ImageField, possibly extending a BytesField, along with other data-science type fields.

For other fields, it could mean deciding if they are unicode, bytes or "target_type".

CharField is obviously unicode, most other things could probably be bytes, except for things like ListField that have a target_type.

No idea how things like ReferenceField would work.

To see the current state: try running under python3, with decode_responses=False and see what breaks (just about everything).

stuaxo avatar May 17 '16 15:05 stuaxo

I really think that storing binary in redis is outside the scope of the ORM. There are tons of ways to handle this. For an image, let's store a path ... and so on.

kiddouk avatar May 19 '16 14:05 kiddouk