Skip to main content

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

Project description

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.3.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

django_restricted_fields-0.3.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for django_restricted_fields-0.3.1.tar.gz
Algorithm Hash digest
SHA256 64b5f29f878a85ed8c28dd32a2b7630c41d216df87b4036d01c5821cb74bb136
MD5 09688cdfe2a962c8cec3601a420a8a09
BLAKE2b-256 336e17726ccc50ae855685d1fe3221f0dc0b2b93d463d19a0c3417e14604cd2e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_restricted_fields-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dd40366b99e50f47b8d62aafa1053626136f8c365c0d4dff9095853409d4fd28
MD5 ab696da93f53b1e9485a0d893f2efdb3
BLAKE2b-256 6b32c126760d4ed08948fae2aec7ac53e5e353ad32cf594c86994c9b51df4838

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