django app in a table that you want to build a foreign key to another table in the app how to achieve?

Direct app name point table name on it.
E.g:

actor_id = models.ForeignKey("actor.Actor", related_name="movietoactor", on_delete=models.CASCADE, db_constraint=False, null=True, blank=True, verbose_name="演员id")

Guess you like

Origin www.cnblogs.com/chanyuli/p/12078333.html