def add_format_field(record, fieldname):
    """Return record with fieldname added to the FORMAT field if it doesn't
    already exist.
    """
    format = record.FORMAT.split(':')
    if fieldname not in format:
        record.FORMAT = record.FORMAT + ":" + fieldname
    return record