Skip to main content

simple extensions to Django form

Project description

ezform

simple extensions to Django forms

Usage

from ezform.fields import DateRangeField

class MyForm(Form):
   range = DateRangeField()

Advanced Usage

  1. declare a concrete data model:
# myapp.models
from ezform.models import Date

class MySkipDate(Date):
    class Meta:
        abstract = False

and update DB schema:

export DJANGO_SETTINGS_MODULE=mywebapp.settings
django-admin makemigrations
django-admin migrate
  1. add required configuration to project settings:
# mywebapp.settings
EZFORM_SETTING = {
    'SKIP_LIST': 'myapp.MySkipDate'
}
  1. get day counts:
import datetime
from ezform.utils import DayCount

day_count = DayCount(
    datetime.date(2019, 12, 15),
    datetime.date(2020,  1, 6)
).do()

Bylaws

Copyright 2016-2023 Xingeng Chen

License: Apache License 2.0

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

ezform-2020.8.6-py3-none-any.whl (19.9 kB view hashes)

Uploaded Python 3

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