title: Filtering in Django Model Form where the user inputs the filter values
body: <p>I am quite new to django and although my enthusiasm I am stuck to the below:</p>
  
  <p>I have the model</p>
  
  <pre><code>class Task(models.Model):
      Taskdetails = models.CharField(max_length=500, null=True)
      asset = models.ForeignKey('Asset', null=True)
  
      def __str__(self):
          return str(self.id)
  </code></pre>
  
  <p>and I have created several objects with the ModelForm technique</p>
  
  <p>I want to create a template that a user can choose an asset and by pressing the button to display all the tasks that are connected with this asset. I mention that an asset has many tasks. I am trying to do that using Django ModelForm.</p>
  
  <p>So, I created first of all the form</p>
  
  <pre><code>class HistoryForm(ModelForm):
  
      class Meta:
          model = Task
          fields =('asset',)
  </code></pre>
  
  <p>Then  I created the view "history" where a user can choose the asset that is interested:</p>
  
  <pre><code>def history(request):
      if request.method == "POST":
          hist_form = HistoryForm(request.POST)
          if hist_form.is_valid():
             hist = hist_form.save(commit=False)
             hist.save()
             return ('results')
      else:
         hist_form = HistoryForm()
  
      return render(request, 'TaskTrace/history.html', {'hist_form': hist_form}
  </code></pre>
  
  <p>The html tag (part of it) is the below</p>
  
  <pre><code>{{ hist_form }}
  &lt;p&gt;&lt;a href="{% url 'results'  %}"&gt; &lt;button type="submit" &gt; Results&lt;/button&gt;&lt;/a&gt;&lt;/p&gt;
  </code></pre>
  
  <p>Then I want to take the choice that the user made and transfer it to the next view ('results')</p>
  
  <pre><code>def results(request):
      tasks = Task.objects.filter(asset=request.POST.get('asset', None))
      return render(request, 'Tasktrace/results.html', {'tasks': tasks})
  </code></pre>
  
  <p>And the hmtl template is </p>
  
  <pre><code>{% for task in tasks %}
      &lt;div&gt;
          &lt;p&gt;&lt;a href=""&gt;&lt;u&gt;{{ task }}  &lt;/a&gt;&lt;/p&gt;
      &lt;/div&gt;
  {% endfor %}
  </code></pre>
  
  <p>The problem is that I do not get any tasks. I believe that my big problem is to transfer the value from the first view to the other.</p>
  
  <p>Is it the correct way to do the filtering in ModelForms? I probably miss something here</p>
  
  <p>I really appreciate your help</p>