title: Django get username of logged in user and pass it to models
body: <p>I am creating a project in django in which I have two diff users i.e. Customers and restaurants. I am creating a model for Menu in which I want add to add user name of logged in user to restaurant name in models. Is there anyway to do this. I have searched through the net got answers like foreign key but not able to implement. Also I need username in views to search from database according to username.
  Models.py</p>
  
  <pre><code>class menu_details(models.Model):
      restaurant_name = models.CharField(blank=True, max_length=20)
      dish_name = models.CharField(blank=True, max_length=20)
      dish_type = models.CharField(max_length=10, choices=food_type, default='veg')
      price = models.CharField(blank=True, max_length=20)
      description = models.TextField(blank=True, max_length=5000)
      image = models.ImageField0(blank=True)
  
      class Meta:
          db_table = "menu_details"
  </code></pre>