def __init__(self, form, request, *args, **kwargs):
    '\n        Iterate through the fields of the ``forms.models.Form`` instance and\n        create the form fields required to control including the field in\n        the export (with a checkbox) or filtering the field which differs\n        across field types. User a list of checkboxes when a fixed set of\n        choices can be chosen from, a pair of date fields for date ranges,\n        and for all other types provide a textbox for text search.\n        '
    self.form = form
    self.request = request
    self.form_fields = form.fields.all()
    self.entry_time_name = str(FormEntry._meta.get_field('entry_time').verbose_name)
    super(EntriesForm, self).__init__(*args, **kwargs)
    for field in self.form_fields:
        field_key = ('field_%s' % field.id)
        self.fields[('%s_export' % field_key)] = forms.BooleanField(label=field.label, initial=True, required=False)
        if field.is_a(*fields.CHOICES):
            if field.is_a(fields.CHECKBOX):
                choices = ((True, _('Checked')), (False, _('Not checked')))
            else:
                choices = field.get_choices()
            contains_field = forms.MultipleChoiceField(label=' ', choices=choices, widget=forms.CheckboxSelectMultiple(), required=False)
            self.fields[('%s_filter' % field_key)] = choice_filter_field
            self.fields[('%s_contains' % field_key)] = contains_field
        elif field.is_a(*fields.MULTIPLE):
            contains_field = forms.MultipleChoiceField(label=' ', choices=field.get_choices(), widget=forms.CheckboxSelectMultiple(), required=False)
            self.fields[('%s_filter' % field_key)] = multiple_filter_field
            self.fields[('%s_contains' % field_key)] = contains_field
        elif field.is_a(*fields.DATES):
            self.fields[('%s_filter' % field_key)] = date_filter_field
            self.fields[('%s_from' % field_key)] = forms.DateField(label=' ', widget=SelectDateWidget(), required=False)
            self.fields[('%s_to' % field_key)] = forms.DateField(label=_('and'), widget=SelectDateWidget(), required=False)
        else:
            contains_field = forms.CharField(label=' ', required=False)
            self.fields[('%s_filter' % field_key)] = text_filter_field
            self.fields[('%s_contains' % field_key)] = contains_field
    field_key = 'field_0'
    self.fields[('%s_export' % field_key)] = forms.BooleanField(initial=True, label=FormEntry._meta.get_field('entry_time').verbose_name, required=False)
    self.fields[('%s_filter' % field_key)] = date_filter_field
    self.fields[('%s_from' % field_key)] = forms.DateField(label=' ', widget=SelectDateWidget(), required=False)
    self.fields[('%s_to' % field_key)] = forms.DateField(label=_('and'), widget=SelectDateWidget(), required=False)
Iterate through the fields of the ``forms.models.Form`` instance and
create the form fields required to control including the field in
the export (with a checkbox) or filtering the field which differs
across field types. User a list of checkboxes when a fixed set of
choices can be chosen from, a pair of date fields for date ranges,
and for all other types provide a textbox for text search.
def __init__(self, form, request, *args, **kwargs):
    '\n        Iterate through the fields of the ``forms.models.Form`` instance and\n        create the form fields required to control including the field in\n        the export (with a checkbox) or filtering the field which differs\n        across field types. User a list of checkboxes when a fixed set of\n        choices can be chosen from, a pair of date fields for date ranges,\n        and for all other types provide a textbox for text search.\n        '
    self.form = form
    self.request = request
    self.form_fields = form.fields.all()
    self.entry_time_name = str(FormEntry._meta.get_field('entry_time').verbose_name)
    super(EntriesForm, self).__init__(*args, **kwargs)
    for field in self.form_fields:
        field_key = ('field_%s' % field.id)
        self.fields[('%s_export' % field_key)] = forms.BooleanField(label=field.label, initial=True, required=False)
        if field.is_a(*fields.CHOICES):
            if field.is_a(fields.CHECKBOX):
                choices = ((True, _('Checked')), (False, _('Not checked')))
            else:
                choices = field.get_choices()
            contains_field = forms.MultipleChoiceField(label=' ', choices=choices, widget=forms.CheckboxSelectMultiple(), required=False)
            self.fields[('%s_filter' % field_key)] = choice_filter_field
            self.fields[('%s_contains' % field_key)] = contains_field
        elif field.is_a(*fields.MULTIPLE):
            contains_field = forms.MultipleChoiceField(label=' ', choices=field.get_choices(), widget=forms.CheckboxSelectMultiple(), required=False)
            self.fields[('%s_filter' % field_key)] = multiple_filter_field
            self.fields[('%s_contains' % field_key)] = contains_field
        elif field.is_a(*fields.DATES):
            self.fields[('%s_filter' % field_key)] = date_filter_field
            self.fields[('%s_from' % field_key)] = forms.DateField(label=' ', widget=SelectDateWidget(), required=False)
            self.fields[('%s_to' % field_key)] = forms.DateField(label=_('and'), widget=SelectDateWidget(), required=False)
        else:
            contains_field = forms.CharField(label=' ', required=False)
            self.fields[('%s_filter' % field_key)] = text_filter_field
            self.fields[('%s_contains' % field_key)] = contains_field
    field_key = 'field_0'
    self.fields[('%s_export' % field_key)] = forms.BooleanField(initial=True, label=FormEntry._meta.get_field('entry_time').verbose_name, required=False)
    self.fields[('%s_filter' % field_key)] = date_filter_field
    self.fields[('%s_from' % field_key)] = forms.DateField(label=' ', widget=SelectDateWidget(), required=False)
    self.fields[('%s_to' % field_key)] = forms.DateField(label=_('and'), widget=SelectDateWidget(), required=False)