python - Django: ProgrammingError when dealing with ManyToMany database -
python - Django: ProgrammingError when dealing with ManyToMany database -
started using manytomany
relationships in postgresql database, end
"programming error : relation "sequences_sequence_access" not exist"
can please explain me fault?
models
from django.db import models django.contrib.auth.models import user class sequence(models.model): name = models.charfield(max_length=200) seq = models.textfield() access = models.manytomanyfield(user) def __unicode__(self): homecoming self.name
views
x = sequence(name=minput[0:mindex]) x.seq = alncontent x.save() x.access.add(user.objects.get(username=musername)) #problems start here x.save()
note: did syncdb (but after doing incorrectly once, , field still there , can't remove it)
you have utilize migration here. can utilize south(for django<=1.6). btw documentation:
migrations django’s way of propagating changes create models (adding field, deleting model, etc.) database schema. they’re designed automatic, you’ll need know when create migrations, when run them, , mutual problems might run into.
python database django postgresql many-to-many
Comments
Post a Comment