python - OperationalError: no such table on some ManyToManyFields only -
i creating website product , user models, , wanted create multiple manytomany fields user model (products purchased, sold, etc). when added first cart manytomanyfield on user model , tried in shell:
user.objects.get(username="root").cart.all()
it worked fine , outputted query set of objects of user's cart.
but added other 3 manytomanyfields user model:
items_purchased = models.manytomanyfield("product", related_name="items_purchased") items_sold = models.manytomanyfield("product", related_name="items_sold") items_listed = models.manytomanyfield("product", related_name="items_listed")
however, once checked latest fields:
user.objects.get(username="root").items_purchased.all()
i got error:
operationalerror: no such table: home_user_items_purchased
what tried:
- i made migrations , have synced them database.
- i deleted every migration files except init , 0001.
- i tried migrate migration files seperately in application.
is there way can fix problem without clearing out whole database? django's problem or have done wrong? thanks!
Comments
Post a Comment