PS: After changing the field to BinaryField, read / write works beautiful.

Am Dienstag, 20. März 2018 14:49:35 UTC+1 schrieb Kevin Olbrich:
>
> Hi,
>
> I just noticed a problem with varbinary fields and inspectdb.
> When inspectdb processes all fields, it creates varbinary as CharField but 
> it needs to be BinaryField.
> Using CharField it is impossible to store non-ASCII (non-text) content in 
> these columns.
>
> I noticed that problem when I tried to insert a mac address (hex) into a 
> varbinary field which needs to be UNHEX()'ed before being inserted.
> CharFields forces str() as the value which saves a binary representation 
> as the value (b'...).
>
> Inspectdb should always be handled as BinaryField because that is what it 
> realy is (currently it is some sort of saving an int as str).
>
> Whats your opinion?
>
> Kind regards
> Kevin
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/eca30e74-855d-497b-9117-b3b1337380e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to