JSONField for Django Models

I was needing to store semi-structured data on a model for a project I am working on, but didn't want to parse strings or create a foreign key to a key/value type table.

The use of JSON came to mind via the simplejson library. I thought leveraging Python's dict and list data structures would provide ample flexibility will minimizing any parsing of text (at least directly by me). Before I set out to write a JSON field type, I thought I'd give Google a try and sure enough someone (deadwisdom) had beat me to it.

This snippet is really cool in that now I can declare fields of type JSONField() and simple interact with them as python data types however, they get saved to the database as simplejson encoded strings and rehydrated back from strings into their original data structure, leaving you without having to think about how the data will be stored.