Это мой файл models.py:
content = models.TextField()
seen = models.BooleanField(default=False)
user = models.ForeignKey('Users', on_delete=models.CASCADE)
def _str_(self):
return self.content
class Users(models.Model):
id = models.AutoField(primary_key=True)
name = models.CharField(max_length=20)
online = models.BooleanField(default=False)
def _str_(self):
return self.name
pass
, и я получаю эту ошибку при попытке вставить "models.CASCATE" в модуль on_delete:
File "/workspace/testjson/App/backend/chat/chatApp/models.py", line 8, in Messages
user = models.ForeignKey('Users', on_delete=models.CASCATE)
AttributeError: module 'django.db.models' has no attribute 'CASCATE'```
Could someone explain me why I am getting this error? Thanks <3