我已经为 User Pic 和 User_pic_url 创建了模型字段,我想做的是当我上传图像时,它的路径应该填充在 user_pic_url 中。请注意,我正在从 django admin 本身上传图像。任何想法。
Model.py:
class Main(models.Model):
name = models.CharField(max_length=50)
address = models.CharField(max_length=100)
about = models.TextField()
contact = models.CharField(default='0', max_length=12)
email = models.CharField(default='-', max_length=50)
linkedin = models.CharField(default='-', max_length=50)
github = models.CharField(default='-', max_length=50)
site_name = models.CharField(default='-', max_length=50)
resume = models.FileField()
cover_letter = models.FileField()
user_pic = models.ImageField()
user_pic_url = models.TextField(default="-")
犯罪嫌疑人X
至尊宝的传说
达令说
相关分类