Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refs #23528 -- Made cosmetic edits to swappable_dependency() docs. #16936

Merged
merged 1 commit into from
Jun 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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