'Return a JSON-serialized version of the list of block records, using a
stable ordering.'

@lazy
def json_value(self):

    list_of_block_dicts = [block._asdict() for block in self]
    for block_dict in list_of_block_dicts:
        block_dict['locator'] = unicode(block_dict['locator'])
    data = {u'blocks': list_of_block_dicts, u'course_key': unicode(self.course_key), u'version': self.version}
    return json.dumps(data, separators=(',', ':'), sort_keys=True)
