I have a many-to-many relationship between a link and a term in Django, but when trying to check if the relationship already exists between the link and term I'm getting an undefined variable on the method.
def create_models(my_term, link):
obj, created = WikifyProjectTerms.objects.get_or_create(term = my_term)
With my models as:
class WikifyProjectTerms(models.Model):
id = models.IntegerField(primary_key=True) # AutoField?
term = models.CharField(max_length=100)
class WikifyProjectLinks(models.Model):
id = models.IntegerField(primary_key=True) # AutoField?
links = models.CharField(max_length=100)
class WikifyProjectLinksTerms(models.Model):
id = models.IntegerField(primary_key=True) # AutoField?
links = models.ForeignKey(WikifyProjectLinks)
terms = models.ForeignKey('WikifyProjectTerms')
I have pasted the line from the django documentation https://docs.djangoproject.com/en/1.4/ref/models/querysets/#get-or-create (and tailored it) but Eclipse is insisting it does not exist, for any of my models. The update_or_create() method doesn't exist either.
Any ideas will be appreciated!
This isn't a runtime error, this is Eclipse complaining:

WikifyProjectLinksTermsindeed doesn't havetermorlinkattributes...