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.2.tar.gz (3.5 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.2-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for django_restricted_fields-0.4.2.tar.gz
Algorithm Hash digest
SHA256 87fcac931398b4b225f0f96261c7bd0abf8edb8be5adacfbdc43f19520edc44a
MD5 4624ee9fa9141070c9e0f0be4e5ffab7
BLAKE2b-256 8510ab3218decdc20a2a74459ed4dc34a22597d29304fac82985b4c76b867c36

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_restricted_fields-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 58b4d66ca0248da4ce3afc08f61aa1ae907138daf2f1ac6f9c4dd5a4e4a45068
MD5 972c5778b0b98dd13861b379620883f5
BLAKE2b-256 752a88b812c87436b2adbeb70eedc7971b1d3ac450dcaa796fe3a23a1e3bad74

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