The issue is that one of the fields use choices. If I remove this
everything is fine!

On 17 June 2016 at 16:58, 'David Turner' via Django users <
django-users@googlegroups.com> wrote:

> I am using django-filter
>
> I have create the the filter as follows:
> filters.py
> import django_filters
> from .models import Job
>
>
> class JobFilter(django_filters.FilterSet):
>     class Meta:
>         model = Job
>         fields = ['practice_type']
>
> And I have created the following view:
> from .models import Job
> from .filters import JobFilter
>
>
> def jobs_list(request):
>     filter = JobFilter(request.GET, queryset=Job.objects.all())
>     return render(request, 'jobs/jobs_list.html', {'filter': filter})
>
> job_list.html
> And then a templater as follows:
> {% block content %}
>     <form action="" method="get">
>         {{ filter.form.as_p }}
>         <input type="submit" />
>     </form>
>     {% for job in filter %}
>         {{ job.name }} <br />
>     {% endfor %}
> {% endblock %}
>
> Everything is fine and the filter shows on the relevant page
>
> However on pressing submit no results are returned.
>
> I know this is probably something quite simple but I have been staring at
> this for so long now any help would be appreciated.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/nLi_L_Pm7as/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c454499d-ddfe-48b8-be67-53a7535de0b0%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/c454499d-ddfe-48b8-be67-53a7535de0b0%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALwQ%2B-tZjS1kVODCxzu_j2BsCCrKHQ6RhERpM%3DQ%2B2Fb605MEZg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
  • Django Filter 'David Turner' via Django users
    • Re: Django Filter 'David Turner' via Django users

Reply via email to