Skip to content
Snippets Groups Projects
Commit 23632e1e authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Merge branch 'fix-typos' into 'master'

Fix typos

See merge request !2
parents d5180a4f 73cb1e27
No related branches found
No related tags found
1 merge request!2Fix typos
...@@ -21,7 +21,7 @@ def order_model_dependencies( ...@@ -21,7 +21,7 @@ def order_model_dependencies(
order: Optional[list[Model]] = None, order: Optional[list[Model]] = None,
seen: Optional[set[Model]] = None, seen: Optional[set[Model]] = None,
) -> list[Model]: ) -> list[Model]:
"""Order a list of models by their dependenceis on wach other. """Order a list of models by their dependencies on wach other.
As input, a model graph as a dictionary with origin models as keys and sets of As input, a model graph as a dictionary with origin models as keys and sets of
target models as values is expected, along with an optional list of models target models as values is expected, along with an optional list of models
...@@ -69,10 +69,10 @@ def build_model_graph( ...@@ -69,10 +69,10 @@ def build_model_graph(
) -> dict[Model, set[Model]]: ) -> dict[Model, set[Model]]:
"""Determines a graph of model dependencies by looking at foreign keys. """Determines a graph of model dependencies by looking at foreign keys.
As input, a list of models to determien the graph for is expected. The other arguments As input, a list of models to determine the graph for is expected. The other arguments
control the mode of operation: control the mode of operation:
closed - Only include dependenceis in the input list; ignore all other models found closed - Only include dependencies in the input list; ignore all other models found
ignore_m2m - Do not consider many-to-many fields ignore_m2m - Do not consider many-to-many fields
ignore_allow_null - Do not consider nullable foreign keys ignore_allow_null - Do not consider nullable foreign keys
...@@ -111,21 +111,21 @@ def resolve_model_dependencies( ...@@ -111,21 +111,21 @@ def resolve_model_dependencies(
graph, then resolves it into a strict order. The other arguments control graph, then resolves it into a strict order. The other arguments control
the mode of operation: the mode of operation:
closed - Only include dependenceis in the input list; ignore all other models found closed - Only include dependencies in the input list; ignore all other models found
perfect - The order must be perfect, including all models perfect - The order must be perfect, including all models
If perfect is set to True, a strict order without any circular dependencies If perfect is set to True, a strict order without any circular dependencies
must be determined on first try. must be determined on first try.
If perfect is set to False, a best effort is made to construct an order, by If perfect is set to False, a best effort is made to construct an order, by
trying several strategies, getting mroe relaxed every time: trying several strategies, getting more relaxed every time:
1. Perfect order 1. Perfect order
2. Ignore many-to-many relationships (these can always be NULL) 2. Ignore many-to-many relationships (these can always be NULL)
3. Ignore all nullable fields 3. Ignore all nullable fields
Returns an ordered list of models if perfect is True, or a tuple with an ordered Returns an ordered list of models if perfect is True, or a tuple with an ordered
list of models and a set of iperfectly ordered models. list of models and a set of imperfectly ordered models.
(If imperfect resolution was done and the set of imperfectly ordered models is (If imperfect resolution was done and the set of imperfectly ordered models is
non-empty, any action involving these models can be gracefully retried.) non-empty, any action involving these models can be gracefully retried.)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment