title: Django query accessing data
body: <p>How do I access the data from the user from another table? I just want to extract a number from a database for specifically loggedIn user.</p>
  <p>Then use it for another function. The number is in another table, but I have used the user as a foreign key.</p>
  <p>Here is my <code>view.py</code>:</p>
  <pre><code>def showform(request):
      form = FormNumber()
      if request.user.is_authenticated:
          phone = customer.objects.filter(phone='phone')
          print(phone)
  
      context = {'form': form}
      return render(request, 'mpesa/pay.html', context)
  </code></pre>
  <p>Here is my <code>model.py</code>:</p>
  <pre><code>class customer(models.Model):
      user = models.ForeignKey(User, on_delete=CASCADE)
      phone = models.CharField(max_length=50)
  
      def __str__(self):
          return str(self.user)
  </code></pre>