Hello,
I am creating an application in django and I have a model with the NewDemand class in which I need when the user creates a demand, the face name is saved in a field. Here's my class:
class NewDemand(models.Model):
name = models.CharField(max_length=150)
date_created = models.DateTimeField(auto_now_add=True, blank=True)
date_max = models.DateField(db_index=True)
requester_user = models.ForeignKey(User)
demand_desc = models.TextField()
def __str__(self):
return str(self.name)
I tried to put a models.ForeugnKey(User)
but on the admin page a field appears with a menu that contains all the users. I want the user name to go directly to the database without having to appear on the admin page at the time of inputting the data.