[Fixed]-How to set "BINARY" to VARCHAR column definition for MySQL with django.models?

1👍

As a workaround you can inherit from CharField and create you own field:

class CustomBinaryCharField(models.CharField):
    def db_type(self, connection):
        return super(CustomBinaryCharField, self).db_type(connection) + ' binary'

Here is a link to Django doc about custom fields.

Leave a comment