InvalidCursorName в проекте django
Вот мой файл models.py:
class TaskDetails(models.Model):
TASK_CHOICES = [
('ploughing', 'Ploughing'),
('sowing', 'Sowing'),
('watering', 'Watering'),
('harvesting', 'Harvesting'),
]
task = models.CharField(max_length=50, choices=TASK_CHOICES)
start_date = models.DateField()
end_date = models.DateField()
task_assigned_to = models.ForeignKey(WorkerDetails, on_delete=models.CASCADE)
equipment_required = models.ManyToManyField(EquipmentDetails, related_name='tasks')
def __str__(self):
return self.task
def clean(self):
# Ensure all required equipment is available
for equipment in self.equipment_required.all():
if equipment.status != 'available':
raise ValidationError(f'Equipment {equipment.equipment} is not available.')
def save(self, *args, **kwargs):
self.clean() # Ensure clean method is called before saving
super().save(*args, **kwargs)
Я получаю следующую ошибку: cursor "_django_curs_20672_sync_2" does not exist И я использую postgresql для базы данных
Как устранить эту ошибку?