I receiving an error AttributeError: 'Manager' object has no attribute 'create_or_update'
in my views.py upon using create_or_update below. My code is shown below:
SlotFilling.objects.create_or_update(
originator=textobject.originator,
defaults = {empty_slot: True,
relevant_intent: intent_rank1,
ner_entities_list: ner_entities,}
)
I'm not sure how to resolve this error. I'm using Django 1.11.2
, so create_or_update
should be supported. The only thing I can think of is that I must have missed something in my model.py
. I've included that below. Any insights into what might be happening?
My models.py:
from django.db import models
class SlotFilling(models.Model):
originator = models.CharField(max_length=20, primary_key=True)
empty_slot = models.BooleanField(default=False)
relevant_intent = models.CharField(max_length=20)
slotted_entity = models.CharField(max_length=20)
ner_entities_list = models.CharField(max_length=40)
It is update_or_create
and not create_or_update
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With