I am developing a web app and I want to use query parameter to show the task description. Currently I am using a post method which gets the ticked checkboxes and then redirects it to another view then that displays the description. Here is my code:
Here is my views.py:
@login_required
def view_task_description(request):
    if request.method == 'POST':
        task_description = GetTaskDescription(data=request.POST, user=request.user)
        if task_description.is_valid():
            obj = GetTaskDescription.get_task_description(task_description)
            return redirect('get_task_description', pk=obj[0].pk)
    return render(request, 'todoapp/select_task_description.html', context={'view_tasks': GetTaskDescription(user=request.user)})
@login_required
def get_task_description(request, pk):
    obj = get_object_or_404(Task, pk=pk)
    return render(request, 'todoapp/task_desc.html', context={'description': obj.description})
Here is my forms.py:
class GetTaskDescription(forms.Form):
    get_tasks = forms.ModelMultipleChoiceField(
        queryset=Task.objects.none(),
        widget=forms.CheckboxSelectMultiple,
        required=True
    )
    def __init__(self, *args, **kwargs):
        self.user = kwargs.pop('user')
        super(GetTaskDescription, self).__init__(*args, **kwargs)
        self.fields['get_tasks'].queryset = self.user.task_set.all()
    def get_task_description(self):
        tasks = self.cleaned_data['get_tasks']
        return tasks
Here is my urls:
url(r'^view_task_description/$', views.view_task_description, name='view_task_description'),
url(r'^view_task_description/(?P<pk>[0-9]+)/$', views.get_task_description, name="get_task_description"),
I want to display the task description simply using get and not the whole way around using post and then get. I am not able to figure that out. Kindly help me.
 
    