def format_field(center, field):
    """
    Given a registration center and a field name, return the value
    of the field formatted to export in a CSV file.
    """
    if field == 'center_type':
        return str(center.get_center_type_display())
    # We never want to print "None", but "0" is okay.
    val = getattr(center, field, None)
    if val is None:
        val = ''
    return str(val)