'Converts a dict into a string of the form ``{key1: val1, key2: val2, ...}``.
This is suitable for ``map`` type columns.'

def cql_encode_map_collection(self, val):

    return ('{%s}' % ',    '.join((('%s:    %s' % (self.mapping.get(type(k), self.cql_encode_object)(k), self.mapping.get(type(v), self.cql_encode_object)(v))) for (k, v) in six.iteritems(val))))
