That's actually pretty helpful, and sort of gets me closer the what I was 
proposing. I'm just perplexed why there's no support for the VARBINARY type 
similar to the VARCHAR used for CharField. Admittedly I've never had call 
to use this type before, but I just found it surprising that there wasn't a 
clear analog to CharField for bytestrings.


MySQL VARBINARY: 
http://dev.mysql.com/doc/refman/5.7/en/binary-varbinary.html
Postgres 
BYTEA: https://www.postgresql.org/docs/current/static/datatype-binary.html
MSSQL VARBINARY: https://msdn.microsoft.com/en-us//library/ms188362.aspx



 
On Thursday, September 8, 2016 at 11:36:03 AM UTC-5, Tim Graham wrote:
>
> Maybe the fields from django-mysql help?
>
> http://django-mysql.readthedocs.io/en/latest/model_fields/resizable_text_binary_fields.html
>
> On Thursday, September 8, 2016 at 10:56:15 AM UTC-4, Chris Foresman wrote:
>>
>> I had a need to store an encrypted bytestring, and CharField doesn't 
>> work. But BinaryField uses LONGBLOB by default (at least on MySQL). Doesn't 
>> it make more sense to have a BinaryField equivalent of CharField, and use 
>> LONGBLOB for something analogous to TextField? As far as I can tell, the 
>> MySQL documentation definitely considers LONGBLOB/BLOB analogous to TEXT. 
>> Not sure the best way to approach an improvement, though; add a 
>> BytestringField? Would this be best served as a third-party package, or 
>> should it be part of Django proper?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/81a7e504-28f8-4d12-91ae-81cbd3e207da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to