title: How to use query value from [[def get_queryset(self)]] and use in all classes
body: <p>search.html file</p>
  
  <pre class="lang-html prettyprint-override"><code>    &lt;div class="content-section"&gt;
          &lt;h1 class="mb-3"&gt;{{ user.username }}&lt;/h1&gt;
              &lt;form method="GET" action="{% url 'doctor:search' %}"&gt;
                  &lt;input name ="q" value="{{request.GET.q}}" placeholder="search.."&gt;
                  &lt;button class="btn btn-success" type="submit"&gt;
                      Search
                  &lt;/button&gt;
              &lt;/form&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p><code>VIEWS.py</code> 
  How can i use [[query = self.request.GET.get('q')_]] once and use it's result in other class?
  Currently i'm using search.html repeatedly to get 'query' value for all other classes. Where value of 'query' is same for all the classes.</p>
  
  <pre><code>class SearchResultsView(ListView):
          model = User
          template_name = 'all_users/doctor/search_result.html'
  
      def get_queryset(self):  
          query = self.request.GET.get('q')
          object_list = User.objects.filter(Q(username__icontains=query))
          return object_list
  
  class PostCreateView(LoginRequiredMixin, CreateView):
      template_name = 'all_users/doctor/post_form.html'
      model = Post
      fields = ['title', 'content', 'comment']
  
      def form_valid(self, form):
          query = self.request.GET.get('q')
          form.instance.author = self.request.user
          form.instance.patient = User.objects.get(username=query)
          return super().form_valid(form)
  
  </code></pre>