Skip to main content

No project description provided

Project description

Django Date Validators

A set of custom validators for validating date and datetime fields for Django.

Installation

  1. Install the package using pip:
pip install django-datetime-validators
  1. Add datetime_validators to INSTALLED_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

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_datetime_validators-0.1.tar.gz (3.6 kB view details)

Uploaded Source

File details

Details for the file django_datetime_validators-0.1.tar.gz.

File metadata

File hashes

Hashes for django_datetime_validators-0.1.tar.gz
Algorithm Hash digest
SHA256 0235de5bbdc783769d5d7dec0d2dfefa6475bfd899724b0186cba432a0e67ae3
MD5 b6a7d65249e33b1931f2e80c144db408
BLAKE2b-256 514c7e838152917139a629602eaa4ba4f0ffe0ba9f41d1e94297f0bf26ecbba7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page