Answer the question
In order to leave comments, you need to log in
How to add any information to the already existing attributes in the model in the database in views.py?
Let's say I have a model
class Customer(models.Model):
user = models.ForeignKey(User, verbose_name='Пользователь', on_delete=models.CASCADE, blank=True, null=True,
max_length=25)
avatar = models.ImageField("Аватар", upload_to="photos/%Y/%m/%d", default='photos/profile.png', blank=True)
date = models.DateField("Дата создания", auto_now=False, auto_now_add=True, blank=True, null=True)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question