def write_bonds(CGModel, pdb_object):
    """
        Writes the bonds from an input CGModel class object to the file object 'pdb_object', using PDB 'CONECT' syntax.

        :param CGModel: CGModel() class object
        :type CGModel: class

        :param pdb_object: File object to which we will write the bond list
        :type pdb_object: file

        """
    bond_list = CGModel.bond_list
    for bond in bond_list:
        if int(bond[0]) < int(bond[1]):
            pdb_object.write('CONECT' + str('{:>5}'.format(bond[0] + 1)) +
                str('{:>5}'.format(bond[1] + 1)) + '\n')
        else:
            pdb_object.write('CONECT' + str('{:>5}'.format(bond[1] + 1)) +
                str('{:>5}'.format(bond[0] + 1)) + '\n')
    pdb_object.write(str('END\n'))
    return
