title: Django how go get all products for the logged in user only?
body: <p>i have the following code, and when the page is displayed the table shows all products for all users no matter which user is logged in.
  I want to show in the table only the products that was created by the logged in user only, not from all users.
  Any help with my issue ?
  Thank you in advance.</p>
  
  <p>views.py</p>
  
  <pre><code>@login_required
  def eadmin(request):
      transactions = Product.objects
      return render(request, 'accounts/index.html', {'transactions': transactions})
  </code></pre>
  
  <p>models.py</p>
  
  <pre><code>class Product(models.Model):
      details = models.CharField(max_length=1000)
      opname = models.CharField(max_length=100)
      pub_date = models.DateTimeField()
      amount = models.IntegerField()
      contactemail = models.TextField()
      purpose = models.TextField()
      poster = models.ForeignKey(User, on_delete=models.CASCADE)
      transactionid = models.CharField(max_length=6)
  
      def __str__(self):
          return self.transactionid
  </code></pre>
  
  <p>In the html template:</p>
  
  <pre><code>      &lt;table class="table"&gt;
          &lt;thead&gt;
            &lt;tr&gt;
              &lt;th scope="col"&gt;#&lt;/th&gt;
              &lt;th scope="col"&gt;XXXXX&lt;/th&gt;
              &lt;th scope="col"&gt;Amount €&lt;/th&gt;
              &lt;th scope="col"&gt;Transaction ID&lt;/th&gt;
            &lt;/tr&gt;
          &lt;/thead&gt;
          {% for transaction in transactions.all %}
          &lt;tbody&gt;
              &lt;tr&gt;
              &lt;th scope="row"&gt;-&lt;/th&gt;
              &lt;td&gt;{{ transaction.opname }}&lt;/td&gt;
              &lt;td&gt;{{ transaction.amount }}&lt;/td&gt;
              &lt;td&gt;{{ transaction.transactionid }}&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/tbody&gt;
         {% endfor %}
        &lt;/table&gt;
  </code></pre>