No project description provided
Project description
Django Date Validators
A set of custom validators for validating date and datetime fields for Django.
Installation
- Install the package using pip:
pip install django-datetime-validators
- Add
datetime_validators
toINSTALLED_APPS
INSTALLED_APPS = [
...,
"datetime_validators",
]
Usage
Date Is Future Validator
Checks if a date is in the future.
from datetime_validators.validators import date_time_is_future_validator
# Using in Models
due_date = models.DateTimeField(
validators=[date_time_is_future_validator]
)
Other Validators
- date_is_future_validator: Checks if a date is in the future.
- date_is_present_or_future_validator: Ensures that a date is either in the present or in the future.
- date_is_past_validator: Validates that a date is in the past.
- date_is_present_or_past_validator: Checks if a date is either in the present or in the past.
- date_time_is_future_validator: Validates if a datetime is in the future.
- date_time_is_present_or_future_validator: Checks if a datetime is either in the present or in the future.
- date_time_is_past_validator: Ensures that a datetime is in the past.
- date_time_is_present_or_past_validator: Validates that a datetime is either in the present or in the past.
Contributing
Contributions are more than wellcome :)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django_datetime_validators-0.1.tar.gz
.
File metadata
- Download URL: django_datetime_validators-0.1.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0235de5bbdc783769d5d7dec0d2dfefa6475bfd899724b0186cba432a0e67ae3 |
|
MD5 | b6a7d65249e33b1931f2e80c144db408 |
|
BLAKE2b-256 | 514c7e838152917139a629602eaa4ba4f0ffe0ba9f41d1e94297f0bf26ecbba7 |