Hello Maxime²,

2010/6/21 Maxime Hadjinlian <[email protected]>:
> --- a/www/maposmatic/views.py
> +++ b/www/maposmatic/views.py
> @@ -141,21 +141,16 @@ def all_maps(request):
>     terms, when provided."""
>
>     map_list = None
> -
> -    if request.method == 'POST':
> -        form = forms.MapSearchForm(request.POST)
> -        if form.is_valid():
> -            map_list = (models.MapRenderingJob.objects
> -                        .order_by('maptitle')
> -                        .filter(status=2)
> -                        
> .filter(maptitle__icontains=form.cleaned_data['query']))
> -            if len(map_list) == 1:
> -                return HttpResponseRedirect(reverse('job-by-id',
> -                                                    args=[map_list[0].id]))
> -
> -            # TODO: find a way to have a working paginator. For now, limit to
> -            # ITEMS_PER_PAGE results.
> -            map_list = map_list[:www.settings.ITEMS_PER_PAGE]
> +    form = forms.MapSearchForm(request.GET)
> +
> +    if form.is_valid():
> +        map_list = (models.MapRenderingJob.objects
> +                    .order_by('maptitle')
> +                    .filter(status=2)
> +                    .filter(maptitle__icontains=form.cleaned_data['query']))
> +        if len(map_list) == 1:
> +            return HttpResponseRedirect(reverse('job-by-id',
> +                                                args=[map_list[0].id]))

On this patch you do not test "if request.method == 'GET':". Can I
assume this code is not necessary?

Best regards,
david

Reply via email to