model-bakery 1.18.1__tar.gz → 1.18.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of model-bakery might be problematic. Click here for more details.
- {model_bakery-1.18.1 → model_bakery-1.18.2}/PKG-INFO +1 -1
- model_bakery-1.18.2/model_bakery/__about__.py +1 -0
- {model_bakery-1.18.1 → model_bakery-1.18.2}/model_bakery/baker.py +6 -0
- {model_bakery-1.18.1 → model_bakery-1.18.2}/model_bakery/recipe.py +2 -1
- {model_bakery-1.18.1 → model_bakery-1.18.2}/pyproject.toml +5 -7
- model_bakery-1.18.1/model_bakery/__about__.py +0 -1
- {model_bakery-1.18.1 → model_bakery-1.18.2}/.gitignore +0 -0
- {model_bakery-1.18.1 → model_bakery-1.18.2}/LICENSE +0 -0
- {model_bakery-1.18.1 → model_bakery-1.18.2}/README.md +0 -0
- {model_bakery-1.18.1 → model_bakery-1.18.2}/model_bakery/__init__.py +0 -0
- {model_bakery-1.18.1 → model_bakery-1.18.2}/model_bakery/_types.py +0 -0
- {model_bakery-1.18.1 → model_bakery-1.18.2}/model_bakery/content_types.py +0 -0
- {model_bakery-1.18.1 → model_bakery-1.18.2}/model_bakery/exceptions.py +0 -0
- {model_bakery-1.18.1 → model_bakery-1.18.2}/model_bakery/generators.py +0 -0
- {model_bakery-1.18.1 → model_bakery-1.18.2}/model_bakery/gis.py +0 -0
- {model_bakery-1.18.1 → model_bakery-1.18.2}/model_bakery/mock_file.txt +0 -0
- {model_bakery-1.18.1 → model_bakery-1.18.2}/model_bakery/mock_img.jpeg +0 -0
- {model_bakery-1.18.1 → model_bakery-1.18.2}/model_bakery/py.typed +0 -0
- {model_bakery-1.18.1 → model_bakery-1.18.2}/model_bakery/random_gen.py +0 -0
- {model_bakery-1.18.1 → model_bakery-1.18.2}/model_bakery/timezone.py +0 -0
- {model_bakery-1.18.1 → model_bakery-1.18.2}/model_bakery/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: model-bakery
|
|
3
|
-
Version: 1.18.
|
|
3
|
+
Version: 1.18.2
|
|
4
4
|
Summary: Smart object creation facility for Django.
|
|
5
5
|
Project-URL: Homepage, https://github.com/model-bakers/model_bakery
|
|
6
6
|
Author-email: berin <bernardoxhc@gmail.com>, amureki <amureki@hey.com>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.18.2"
|
|
@@ -638,6 +638,9 @@ class Baker(Generic[M]):
|
|
|
638
638
|
for key, values in attrs.items():
|
|
639
639
|
manager = getattr(instance, key)
|
|
640
640
|
|
|
641
|
+
if callable(values):
|
|
642
|
+
values = values()
|
|
643
|
+
|
|
641
644
|
for value in values:
|
|
642
645
|
# Django will handle any operation to persist nested non-persisted FK because
|
|
643
646
|
# save doesn't do so and, thus, raises constraint errors. That's why save()
|
|
@@ -659,6 +662,9 @@ class Baker(Generic[M]):
|
|
|
659
662
|
|
|
660
663
|
def _handle_m2m(self, instance: Model):
|
|
661
664
|
for key, values in self.m2m_dict.items():
|
|
665
|
+
if callable(values):
|
|
666
|
+
values = values()
|
|
667
|
+
|
|
662
668
|
for value in values:
|
|
663
669
|
if not value.pk:
|
|
664
670
|
value.save()
|
|
@@ -78,7 +78,8 @@ class Recipe(Generic[M]):
|
|
|
78
78
|
else:
|
|
79
79
|
mapping[k] = v.recipe.prepare(_using=_using, **recipe_attrs)
|
|
80
80
|
elif isinstance(v, related):
|
|
81
|
-
mapping[k] = v.make
|
|
81
|
+
mapping[k] = v.make
|
|
82
|
+
|
|
82
83
|
mapping.update(new_attrs)
|
|
83
84
|
mapping.update(rel_fields_attrs)
|
|
84
85
|
return mapping
|
|
@@ -94,9 +94,7 @@ disallow_untyped_calls = true
|
|
|
94
94
|
[tool.pytest.ini_options]
|
|
95
95
|
addopts = "--tb=short -rxs --nomigrations"
|
|
96
96
|
|
|
97
|
-
[tool.ruff]
|
|
98
|
-
target-version = "py38"
|
|
99
|
-
|
|
97
|
+
[tool.ruff.lint]
|
|
100
98
|
select = [
|
|
101
99
|
"S", # flake8-bandit
|
|
102
100
|
"B", # flake8-bugbear
|
|
@@ -113,19 +111,19 @@ select = [
|
|
|
113
111
|
|
|
114
112
|
ignore = ["B904", "E501", "S101", "D1", "D212"]
|
|
115
113
|
|
|
116
|
-
[tool.ruff.per-file-ignores]
|
|
114
|
+
[tool.ruff.lint.per-file-ignores]
|
|
117
115
|
"tests/test_*.py" = [
|
|
118
116
|
"S",
|
|
119
117
|
]
|
|
120
118
|
|
|
121
|
-
[tool.ruff.isort]
|
|
119
|
+
[tool.ruff.lint.isort]
|
|
122
120
|
combine-as-imports=true
|
|
123
121
|
split-on-trailing-comma=true
|
|
124
122
|
section-order = ["future", "standard-library", "django", "third-party", "first-party", "local-folder"]
|
|
125
123
|
force-wrap-aliases=true
|
|
126
124
|
|
|
127
|
-
[tool.ruff.isort.sections]
|
|
125
|
+
[tool.ruff.lint.isort.sections]
|
|
128
126
|
django = ["django"]
|
|
129
127
|
|
|
130
|
-
[tool.ruff.pydocstyle]
|
|
128
|
+
[tool.ruff.lint.pydocstyle]
|
|
131
129
|
convention = "google"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.18.1"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|