A Django seeding solution build on top of fixtures
Project description
NWON Django seeding
A bunch of functions that you can use for creating seeds for your current application state and loading them.
This is build on top of Django fixtures. This package helps you handle database content and media files as well.
Settings
The Django Seeding package can be configured using the Django settings. We expect the key NWON_DJANGO_SEEDING that holds a dictionary or a pydantic object of type NWONDjangoSeedingSettings. The dictionary must be parsable by NWONDjangoSeedingSettings. The keys mus be snake case or camel case.
For example like this
def directories_for_environment(environment: str) -> SeedDirectories:
return SeedDirectories(default_directory="", environment_directory="")
def file_seeds_for_environment(environment: str) -> List[ModelFolderMapping]:
return []
def disable_seeding() -> List[Type[Model]]:
return []
def custom_seed_map() -> Dict[Type[Model], Dict[str, str]]:
return {}
NWON_DJANGO_SEEDING: NWONDjangoSeedingSettings = {
disable_signals_before_seeding_model=disable_seeding,
custom_seed_map=custom_seed_map,
directories_for_environment=directories_for_environment,
file_directories_for_environment=file_seeds_for_environment,
default_app_name="nwon",
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nwon_django_seeding-1.0.8.tar.gz.
File metadata
- Download URL: nwon_django_seeding-1.0.8.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.11.6 Linux/6.5.0-45-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57d54373f03e637037a92efed4227ae2d175b40aed397d06e4e87cff2e0d769f
|
|
| MD5 |
50a374db28a4945fce1c991524f39c3d
|
|
| BLAKE2b-256 |
ced1a91ee9694a8aa2edcccd2d2860e7486a8df5b594d675528b7ef2e72f6356
|
File details
Details for the file nwon_django_seeding-1.0.8-py3-none-any.whl.
File metadata
- Download URL: nwon_django_seeding-1.0.8-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.11.6 Linux/6.5.0-45-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
325e79113a8b46cec2f9e228735b88fd6cf62396fcb698c3acc861840b996418
|
|
| MD5 |
d80354813b2d8ebd452cc72d19f1d4ad
|
|
| BLAKE2b-256 |
b0aa8908c81c425eb8b41562ee942b75ed9ac2896bbb62e0655d9329a48d5fd4
|