'@param table_obj is a hive_metastore.thrift Table object,
used to add fields corresponding to partition keys.'

def __init__(self, table_obj, *args, **kwargs):

    super(LoadDataForm, self).__init__(*args, **kwargs)
    self.partition_columns = dict()
    for (i, column) in enumerate(table_obj.partition_keys):
        name = ('partition_%d' % i)
        char_field = forms.CharField(required=True, label=(_t('%(column_name)s    (partition    key    with    type    %(column_type)s)') % {'column_name': column.name, 'column_type': column.type}))
        self.fields[name] = char_field
        self.partition_columns[name] = column.name
