如何在Django中显示其他模型中的特定数据 这是我在我的models.py
中的代码class ProjectName(models.Model):
BacProjectName = models.CharField(max_length=250)
date_created: object = models.DateField(auto_now=True)
def __str__(self):
return self.BacProjectName
class BacFileUpload(models.Model):
Sproject = models.ForeignKey(ProjectName__date_created__year=2019,
on_delete=models.CASCADE)
Sproject = models.ForeignKey(ProjectName__date_created__year=2019, on_delete=models.CASCADE)
TypeError: __init__() missing 1 required positional argument: 'to'