This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple wrapper over the BinaryField. Assumes it is given text and automatically compresses | |
# and decompresses upon access. Intended as a space saving mechanism on what | |
# would normally be bulk text that isn't accessed very often. | |
# Tested on Python3.4 / Django 1.7 | |
from django.db import models | |
from django.utils.translation import ugettext_lazy as _ | |
import lzma | |
class CompressedTextField(models.BinaryField, metaclass=models.SubfieldBase): |