This release is a pre-release and may not be stable for production use.
=======================
Django model validators adds a few common validators in addition to Django's [built-in validators](https://docs.djangoproject.com/en/dev/ref/validators/).
Installation
------------
Run `pip install django-model-validators`
Validators
----------
###FileTypeValidator
Ensures an upload file name ends in an extension.
```python
from django.db import models
from model_validators.validators import FileTypeValidator
class MyModel(models.Model):
even_field = models.IntegerField(validators=[FileTypeValidator('zip')])
```
It can also be passed a list of extensions:
```python
from django.db import models
class MyModel(models.Model):
even_field = models.IntegerField(validators=[FileTypeValidator(['zip', 'txt', 'pdf'])])
```
###NumericRangeValidator
Ensure the field value falls within the specified range.
```python
from django.db import models
from model_validators.validators import NumericRangeValidator
class MyModel(models.Model):
rating = models.PositiveIntegerField(validators=[NumericRangeValidator(1, 10)])
```
Metadata
Release files for django-model-validators 0.1a2
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 | |
|---|---|---|---|---|
| django-model-validators-0.1a2.zip | 6.6 kB | Without provenance | Details |
Release files / django-model-validators-0.1a2.zip
| Download URL | django-model-validators-0.1a2.zip |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d7a0984e17ac8cd9eb8c42699fb3ff73520158afb16a4105457928a432b8331
|
|
BLAKE2b-256 checksum How to use checksums |
f07c850f7a8cb7f5eac5010a550269b90ce011811d1768a24c638c7a7fb8bbc6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-model-validators 0.1a2
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.