[Answer]-Optional foreign key in model related to a model which doesn't exist

0👍

I would recommend that you implement a “stub” Employee model eg

class Employee(models.Model):
    pass

If you are using database migrations ( eg South ), which you should, it should be a simple matter to “fill out” the Employee class later on.

However, if you want a fairly involved “solution” to the problem, you can have a look at the accepted answer in this question. The author of the question & answer admits that it is ugly ( even though it works ). The “stub” solution is better.

1👍

Why don’t you make (temporary) dummy models?

Leave a comment