'Write database content to a JSON file.
Parameters
filename : str
JSON file.
overwrite : bool
If ``True``, overwrite the output file if it exists.
.. versionchanged:: 1.3
``overwrite`` replaces the deprecated ``clobber`` argument.
Raises
OSError
If the file exists and ``overwrite`` is ``False``.'

@deprecated_renamed_argument(u'clobber', u'overwrite', u'1.3')
def to_json(self, filename, overwrite=False):

    if (os.path.exists(filename) and (not overwrite)):
        raise OSError(u'{0}    exists.'.format(filename))
    with open(filename, u'w') as fd:
        fd.write(self.dumps())
