model-bakery 1.19.5__tar.gz → 1.20.0__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.19.5 → model_bakery-1.20.0}/PKG-INFO +2 -1
- model_bakery-1.20.0/model_bakery/__about__.py +1 -0
- {model_bakery-1.19.5 → model_bakery-1.20.0}/model_bakery/baker.py +4 -0
- {model_bakery-1.19.5 → model_bakery-1.20.0}/pyproject.toml +1 -0
- model_bakery-1.19.5/model_bakery/__about__.py +0 -1
- {model_bakery-1.19.5 → model_bakery-1.20.0}/.gitignore +0 -0
- {model_bakery-1.19.5 → model_bakery-1.20.0}/LICENSE +0 -0
- {model_bakery-1.19.5 → model_bakery-1.20.0}/README.md +0 -0
- {model_bakery-1.19.5 → model_bakery-1.20.0}/model_bakery/__init__.py +0 -0
- {model_bakery-1.19.5 → model_bakery-1.20.0}/model_bakery/_types.py +0 -0
- {model_bakery-1.19.5 → model_bakery-1.20.0}/model_bakery/content_types.py +0 -0
- {model_bakery-1.19.5 → model_bakery-1.20.0}/model_bakery/exceptions.py +0 -0
- {model_bakery-1.19.5 → model_bakery-1.20.0}/model_bakery/generators.py +0 -0
- {model_bakery-1.19.5 → model_bakery-1.20.0}/model_bakery/gis.py +0 -0
- {model_bakery-1.19.5 → model_bakery-1.20.0}/model_bakery/mock_file.txt +0 -0
- {model_bakery-1.19.5 → model_bakery-1.20.0}/model_bakery/mock_img.jpeg +0 -0
- {model_bakery-1.19.5 → model_bakery-1.20.0}/model_bakery/py.typed +0 -0
- {model_bakery-1.19.5 → model_bakery-1.20.0}/model_bakery/random_gen.py +0 -0
- {model_bakery-1.19.5 → model_bakery-1.20.0}/model_bakery/recipe.py +0 -0
- {model_bakery-1.19.5 → model_bakery-1.20.0}/model_bakery/timezone.py +0 -0
- {model_bakery-1.19.5 → model_bakery-1.20.0}/model_bakery/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: model-bakery
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.20.0
|
|
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>
|
|
@@ -22,6 +22,7 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
22
22
|
Classifier: Programming Language :: Python :: 3.10
|
|
23
23
|
Classifier: Programming Language :: Python :: 3.11
|
|
24
24
|
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
25
26
|
Classifier: Topic :: Software Development
|
|
26
27
|
Requires-Python: >=3.8
|
|
27
28
|
Requires-Dist: django>=4.2
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.20.0"
|
|
@@ -27,6 +27,7 @@ from django.db.models import (
|
|
|
27
27
|
Model,
|
|
28
28
|
OneToOneField,
|
|
29
29
|
)
|
|
30
|
+
from django.db.models.fields import NOT_PROVIDED
|
|
30
31
|
from django.db.models.fields.proxy import OrderWrt
|
|
31
32
|
from django.db.models.fields.related import (
|
|
32
33
|
ReverseManyToOneDescriptor as ForeignRelatedObjectsDescriptor,
|
|
@@ -727,6 +728,7 @@ class Baker(Generic[M]):
|
|
|
727
728
|
|
|
728
729
|
Generator Resolution Precedence Order:
|
|
729
730
|
-- `field.default` - model field default value, unless explicitly overwritten during baking
|
|
731
|
+
-- `field.db_default` - model field db default value, unless explicitly overwritten
|
|
730
732
|
-- `attr_mapping` - mapping per attribute name
|
|
731
733
|
-- `choices` -- mapping from available field choices
|
|
732
734
|
-- `type_mapping` - mapping from user defined type associated generators
|
|
@@ -750,6 +752,8 @@ class Baker(Generic[M]):
|
|
|
750
752
|
if callable(field.default):
|
|
751
753
|
return field.default()
|
|
752
754
|
return field.default
|
|
755
|
+
elif getattr(field, "db_default", NOT_PROVIDED) != NOT_PROVIDED:
|
|
756
|
+
return field.db_default
|
|
753
757
|
elif field.name in self.attr_mapping:
|
|
754
758
|
generator = self.attr_mapping[field.name]
|
|
755
759
|
elif field.choices:
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.19.5"
|
|
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
|
|
File without changes
|