From 4e279a9450a88327be11548524da12f5d7990215 Mon Sep 17 00:00:00 2001 From: David Wobrock Date: Mon, 20 Dec 2021 19:41:39 +0100 Subject: [PATCH] Add a solution for RunPython import errors --- docs/incompatibilities.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/incompatibilities.md b/docs/incompatibilities.md index 21276d8..cef4e51 100644 --- a/docs/incompatibilities.md +++ b/docs/incompatibilities.md @@ -171,6 +171,8 @@ Instead, once you use the `apps.get_model` function, if the first argument of yo However, in a migration, you should be using the version of the model, at the point in time where this migration was created. It could happen that you use a `RunPython` operation to fill a new column. But if you import that latest version of the model, this column might not exist anymore, which will break a prior migration. +:white_check_mark: **Solution**: use `apps.get_model` to get the model class + ### Others To be added...