+2  A: 

Custom field types are definitely the way to go here. This is the only reliable way to ensure that the field is compressed on save and decompressed on load. Make sure you set the metaclass as described in your link.

Daniel Roseman
Absolutely agree. They are easy to create and can simplify any number of common problems. Google on "django strip charfield" for several takes on a simple extension to models.CharField(), namely stripping leading/trailing spaces. Frankly, I'm surprised it never made it into trunk.
Peter Rowell
+1  A: 

You need to implement to_python and get_prep_value in your custom field type to respectively decompress and compress your data.

Pierre-Jean Coudert