In Django, I have a model, let's call it "MyTable" which uses a content_type Foreign Key to refer to, amongst other things, Profile.
In most cases (as in my unit-tests) I have no trouble with it, but in a certain circumstance in the view I try to save a Profile object (with Profile's .save() ) and the database throws this exception :
relation "_mytable" does not exist
I presume that this is because of some reverse-lookup that the ORM is making between the Profile and MyTable due to the ForeignKey from MyTable to Profile.
Now there definitely is a relation in the database called myapp_mytable. But in this case, the ORM seems to have lost the app-name. Checking the SQL confirms this, it really is trying to select from _mytable instead of myapp_mytable.
Anyone seen anything like this or have suggestions?