Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
django-depmod
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Libraries
django-depmod
Commits
23632e1e
Commit
23632e1e
authored
2 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Plain Diff
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
!2
Fix typos
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
django_depmod/__init__.py
+6
-6
6 additions, 6 deletions
django_depmod/__init__.py
with
6 additions
and
6 deletions
django_depmod/__init__.py
+
6
−
6
View file @
23632e1e
...
@@ -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 dependenc
e
is on wach other.
"""
Order a list of models by their dependenci
e
s 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 determi
e
n the graph for is expected. The other arguments
As input, a list of models to determin
e
the graph for is expected. The other arguments
control the mode of operation:
control the mode of operation:
closed - Only include dependenc
e
is in the input list; ignore all other models found
closed - Only include dependenci
e
s 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 dependenc
e
is in the input list; ignore all other models found
closed - Only include dependenci
e
s 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 m
r
oe relaxed every time:
trying several strategies, getting mo
r
e 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 i
m
perfectly 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.)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment