Skip to main content

Provides date and date/time fields with restrictions for Django forms.

Project description

django-restricted-fields

Usage

Add this package to your virtual environment. In your Django application's forms.py, import the field(s) you want to use (currently only RestrictedDateField and RestrictedDateTimeField). These offer additional options:

  • future_allowed=False – inhibit the input of dates / times that are in the future

  • past_allowed=False – inhibit the input of dates / times that are in the past

  • min_value=X, max_value=X – inhibit the input of dates / times before / after X, where X can be a Python date / datetime value or a callable that returns such a value

Most browsers will display a date and / or time picker whose range is limited by these options.

Other than with Django's native fields, dates (and times) should be formatted according to the locale settings of the browser (which normally is the right thing to do).

Project details


Download files

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

Source Distribution

django_restricted_fields-0.4.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_restricted_fields-0.4.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file django_restricted_fields-0.4.0.tar.gz.

File metadata

File hashes

Hashes for django_restricted_fields-0.4.0.tar.gz
Algorithm Hash digest
SHA256 cc8254bf85297c2ef402bcd6f0c2275048090b0cb423889c05eff74d9b9e3a81
MD5 1ebbdb103422d6fd1423538755434511
BLAKE2b-256 66adefc6c552db4296d914274e60e679cad5ddd7e0a83668591cb9ba15c9a941

See more details on using hashes here.

File details

Details for the file django_restricted_fields-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_restricted_fields-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7cc214c0d8c9addd4d0c1122ce285eb72f986eb8d67a39bf7a9bf49becadce90
MD5 fda0ee97ea99b808fecfa3f50ce914d3
BLAKE2b-256 230b213ed2e1ec36723c337f6cd023e4214eac3b0af887526958249621b470cb

See more details on using hashes here.

Supported by

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