Skip to main content

Incubator for django-crud-views extension apps (widgets, fields)

Project description

django-crud-views-extensions

Incubator for django-crud-views extension apps. Apps here are named as if they lived in django-crud-views itself (crud_views_widget_*); once mature, an app may move into the main package with no code changes for consuming projects.

Requires django-crud-views >= 0.11 (asset registry).

crud_views_widget_datetimepicker

Form widgets wrapping the xdsoft jQuery DateTimePicker: DateTimePickerInput, DatePickerInput, TimePickerInput.

Prerequisite: jQuery loaded in your base template before {% cv_js %} (same rule as django-crud-views core).

Install

pip install django-crud-views-extensions

INSTALLED_APPS = [
    ...
    "crud_views",
    "crud_views_widget_datetimepicker",
]

That's it — the widget's JS/CSS are delivered through {% cv_js %}/{% cv_css %} on every page (including crud-views modals) via the asset registry. By default the plugin files load from jsDelivr (CDN mode).

Use

from crud_views_widget_datetimepicker.widgets import DateTimePickerInput

class AppointmentForm(CrispyModelForm):
    class Meta:
        model = Appointment
        fields = ["title", "starts_at"]
        widgets = {"starts_at": DateTimePickerInput()}

Options: config={...} (any xdsoft option, e.g. step, minTime), and DateTimePickerInput(fix_year=2026) to lock the picker to one calendar year.

Settings

CRUD_VIEWS_DATETIMEPICKER = {
    "SOURCE": "cdn",        # "cdn" (default) | "vendored"
    "VERSION": "2.5.21",    # pinned upstream version, used by both modes
    "CDN_BASE": "https://cdn.jsdelivr.net/npm/jquery-datetimepicker@{version}/build/",
    "VENDOR_DIR": None,     # required for vendored mode; must be on STATICFILES_DIRS
    "EMIT": True,           # False: keep registered but let a bundler deliver the files
    "LANG": None,           # None: derived from LANGUAGE_CODE
    "DEFAULTS": {},         # merged into every widget's picker config
}

Vendored mode (recommended for production / GDPR)

CRUD_VIEWS_DATETIMEPICKER = {"SOURCE": "vendored", "VENDOR_DIR": BASE_DIR / "vendored_static"}
STATICFILES_DIRS = [BASE_DIR / "vendored_static"]

python manage.py cv_vendor_datetimepicker

A system check warns on startup when the vendored files are missing (crud_views.W330) or don't match the pinned VERSION (crud_views.W331).

django-pipeline

CDN mode cannot be bundled. For pipeline, use vendored mode and build your bundle from the same path list the app uses internally — then switch off tag emission:

from crud_views_widget_datetimepicker.assets import source_files

_dtp = source_files("2.5.21", minified=False)   # pipeline minifies itself
PIPELINE = {
    "JAVASCRIPT": {"main": {"source_filenames": [..., *_dtp["js"]], ...}},
    "STYLESHEETS": {"main": {"source_filenames": [..., *_dtp["css"]], ...}},
}
CRUD_VIEWS_DATETIMEPICKER = {"SOURCE": "vendored", "VENDOR_DIR": ..., "EMIT": False}

Keep the order jQuery → plugin → init.js in your bundle (source_files() already returns plugin before init.js).

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_crud_views_extensions-0.1.2.tar.gz (46.7 kB view details)

Uploaded Source

Built Distribution

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

django_crud_views_extensions-0.1.2-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file django_crud_views_extensions-0.1.2.tar.gz.

File metadata

File hashes

Hashes for django_crud_views_extensions-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5b45698211395f236f9467bd62c66fb69a8dc51072651de6c138c95f175afa19
MD5 6751ab0fbc8975502c9d4e04b5b3d27d
BLAKE2b-256 71d9fc7c39521d25e5008c998fcdfb34abf8b6390c7210b09cfb09d7573e8585

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_crud_views_extensions-0.1.2.tar.gz:

Publisher: publish.yml on jacob-consulting/django-crud-views-extensions

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_crud_views_extensions-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_crud_views_extensions-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2c876e313277a61e546463eae54200d82ecf22dbb97a12ebfec72f00c3ac2750
MD5 9ddaa339c1ced1e6ed97d7eaa3cb1d50
BLAKE2b-256 ab756984a1388829269cf51e32ef278526244c12687003910e4b856a65b7cbed

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_crud_views_extensions-0.1.2-py3-none-any.whl:

Publisher: publish.yml on jacob-consulting/django-crud-views-extensions

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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