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
Compare revisions
70c27cc447bf691e32a461bcc0a59f6559ea2161 to 23632e1eaa51ff444ede18628e9c76c00d0cdb15
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
AlekSIS/libs/django-depmod
Select target project
No results found
23632e1eaa51ff444ede18628e9c76c00d0cdb15
Select Git revision
Swap
Target
AlekSIS/libs/django-depmod
Select target project
AlekSIS/libs/django-depmod
1 result
70c27cc447bf691e32a461bcc0a59f6559ea2161
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
Fix typos
· 73cb1e27
magicfelix
authored
2 years ago
73cb1e27
Merge branch 'fix-typos' into 'master'
· 23632e1e
Nik | Klampfradler
authored
2 years ago
Fix typos See merge request
!2
23632e1e
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
View file @
23632e1e
...
...
@@ -21,7 +21,7 @@ def order_model_dependencies(
order
:
Optional
[
list
[
Model
]]
=
None
,
seen
:
Optional
[
set
[
Model
]]
=
None
,
)
->
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
target models as values is expected, along with an optional list of models
...
...
@@ -69,10 +69,10 @@ def build_model_graph(
)
->
dict
[
Model
,
set
[
Model
]]:
"""
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:
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_allow_null - Do not consider nullable foreign keys
...
...
@@ -111,21 +111,21 @@ def resolve_model_dependencies(
graph, then resolves it into a strict order. The other arguments 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
perfect - The order must be perfect, including all models
If perfect is set to True, a strict order without any circular dependencies
must be determined on first try.
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
2. Ignore many-to-many relationships (these can always be NULL)
3. Ignore all nullable fields
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
non-empty, any action involving these models can be gracefully retried.)
...
...
This diff is collapsed.
Click to expand it.