Skip to content

Instantly share code, notes, and snippets.

@amitu
Created March 5, 2016 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amitu/59bbd6ae414bfe20ce0b to your computer and use it in GitHub Desktop.
Save amitu/59bbd6ae414bfe20ce0b to your computer and use it in GitHub Desktop.
CICharField
class CICharField(models.CharField):
def db_type(self, connection):
assert connection
return 'CITEXT'
def from_db_value(self, value, expression, connection, context):
if value and isinstance(value, str):
value = value.decode("utf-8")
return value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment