def create_dialogue_json(dg):
    """Creates a JSON describing a dialogue for purposes of Crowdflower.

    Arguments:
        dg -- a Django dialogue object

    """
    json_str = ('{{"cid":"{cid}","code":"{code}","code_gold":"{gold}"}}'
                .format(cid=dg.cid,
                        code=dg.code,
                        gold=dg.get_code_gold()))
    return json_str