-------------------------------------
This module exports a get_or_create_random function that improves Django's
get_or_create (http://djangoproject.com/documentation/models/get_or_create/)
on two aspects:
* invoking get_or_create_random with parameters that match MULTIPLE instances
does not raise an error, but rather returns one of those instances at random
* invoking get_or_create_random with parameters that do not match ANY instance
returns a NEW instance of that model (the same occurs with get_or_create). The
improvement is that get_or_create_random can be invoked without passing a value
for all the 'required' fields of the model. If these fields are not passed,
they are automatically filled with random values (e.g.: CharFields are filled
with random strings, ImageFields with random images).
The goal is to make prototyping faster, as model instances can be obtained and
created by specifying just the minimum set of desired fields. This is useful
when writing tests and can avoid having to write complex fixtures.
Metadata
Release files for random_instances 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| random_instances-0.0.3.tar.gz | 8.1 kB | Without provenance | Details for random_instances-0.0.3.tar.gz |
Release files / random_instances-0.0.3.tar.gz
| Download URL | random_instances-0.0.3.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d5513a275108df59ca24e1cec7a87dd575a4d3a78281cb987902a3dcaa6db878
|
|
BLAKE2b-256 checksum How to use checksums |
c868cc1eb176786f6d952cea3e4d35b26cc9868429dc677262b86abc3bcbfd1c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for random_instances 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.