#2417: Support for binary type fields (aka: bytea in postgres and VARBINARY in
mysql)
-----------------------------------+----------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: nobody
Status: assigned | Component: Database wrapper
Version: | Resolution:
Keywords: | Stage: Design decision
needed
Has_patch: 1 | Needs_docs: 0
Needs_tests: 1 | Needs_better_patch: 0
-----------------------------------+----------------------------------------
Comment (by mtredinnick):
Whoever works on this should realise it's a little trickier than it looks.
You'll need to work carefully with the database backends so that this
binary data isn't automatically converted to unicode (which happens for
all bytestrings at the moment). Make sure you test with binary data that
cannot possibly be treated as valid UTF-8, so that you don't accidentally
get fooled by it being converted to Unicode. I'd suggest creating a new
class, similar to SmartUnicode, etc, for autoescaping that is used to tell
the database backend *not* to convert this string. Might require some
magical incantations for things like psycopg2 and mysql that do the UTF-8
-> Unicode conversion in the Python database wrapper (beyond the Django
borders); that will need research.
I don't know why this ticket is in design decision needed, since there
aren't any specific questions that seem to be unresolved beyond "what
should we choose?". Just pick something and go. The field doesn't need
infinitely many options. One case cannot possibly meet all requirements in
any case, so pick a practical middle ground that works completely portably
on all our database backends and if people want something else they can
always subclass the field.
If you do need a design discussion, this ticket isn't the place for it. We
have a mailing list for that purpose.
--
Ticket URL: <http://code.djangoproject.com/ticket/2417#comment:36>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---