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 hashes)

Uploaded Source

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