Skip to content

Commit

Permalink
[4.2.x] Refs #23528 -- Made cosmetic edits to swappable_dependency() …
Browse files Browse the repository at this point in the history
…docs.

Backport of 1136aa5 from main
  • Loading branch information
felixxm committed Jun 3, 2023
1 parent 92ad551 commit 66d9fa4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/topics/migrations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,14 @@ Swappable dependencies
.. function:: django.db.migrations.swappable_dependency(value)

The ``swappable_dependency()`` function is used in migrations to declare
"swappable" dependencies on migrations in the app of the swapped-in model.
Currently, the first migration of this app and as a consequence the swapped-in
"swappable" dependencies on migrations in the app of the swapped-in model,
currently, on the first migration of this app. As a consequence, the swapped-in
model should be created in the initial migration. The argument ``value`` is a
string ``"<app label>.<model>"`` describing an app label and a model name, e.g.
``"myapp.MyModel"``.

By using ``swappable_dependency()``, you inform the migration framework that
the migration relies on a migration which sets up up a swappable model,
the migration relies on another migration which sets up a swappable model,
allowing for the possibility of substituting the model with a different
implementation in the future. This is typically used for referencing models
that are subject to customization or replacement, such as the custom user
Expand Down

0 comments on commit 66d9fa4

Please sign in to comment.