https://github.com/acdh-oeaw/acdh-django-widgets

A collection of custom widgets for Django-Forms

https://github.com/acdh-oeaw/acdh-django-widgets

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.1%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

A collection of custom widgets for Django-Forms

Basic Info
  • Host: GitHub
  • Owner: acdh-oeaw
  • License: mit
  • Language: Python
  • Default Branch: main
  • Size: 8.79 KB
Statistics
  • Stars: 0
  • Watchers: 6
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Created over 1 year ago · Last pushed over 1 year ago
Metadata Files
Readme License

README.md

PyPI version pypi flake8 Lint

acdh-django-widgets

acdh-django-widgets is a Django app providing a collection of custom widgets for Django-Forms/Filter

Installation/Usage

Install the package e.g. bash pip install acdh-django-widgets

add acdh-django-widgets to your INSTALLED_APPS

python INSTALLED_APPS = [ ... "acdh-django-widgets", ... ]

Widgets

MartinAntonMuellerWidget

This widget extends django_filters.widgets.RangeWidget to provide a one-line range input interface, separated with a 'Halbgeviertstrich' ('–'). It's designed for numeric range filtering where two input fields (min and max) are displayed in a single line. It is named after @martinantonmueller because he likes the 'Halbgeviertstrich' ('–'). ```python

from acdhdjangowidgets.widgets import MartinAntonMuellerWidget

class MyCustomFilter(FilterSet):

start_date__year = RangeFilter(
    label=" Zeitraum: Anfang – Ende (z. B. 1862–1931)",
    widget=MartinAntonMuellerWidget
)

```

DateRangePickerWidget

A custom DateRangeWidget that renders a date range picker using a template. This widget extends django_filters.widgets.DateRangeWidget to provide a date range picker interface. It uses a custom template for rendering the widget and allows setting minimum and maximum date values.

```python from acdhdjangowidgets.widgets import DateRangePickerWidget

class MyCustomFilter(FilterSet): decissiondate = djangofilters.DateFromToRangeFilter( helptext=CourtDecission.meta.getfield("decissiondate").helptext, label=CourtDecission.meta.getfield("decissiondate").verbose_name, widget=DateRangePickerWidget ) ```

RangeSliderWidget

A Django widget that renders a range slider using noUiSlider. This widget extends django_filters.widgets.RangeWidget to create an interactive range slider for selecting numeric ranges. It uses the noUiSlider JavaScript library for the slider functionality and wNumb for number formatting.

```python from acdhdjangowidgets.widgets import RangeSliderWidget

class MyCustomFilter(FilterSet): year = djangofilters.RangeFilter( helptext=YearBook.meta.getfield("year").helptext, label=YearBook.meta.getfield("year").verbosename, widget=RangeSliderWidget( attrs={"min": "1900", "max": "2030", "hideinputfileds": False} ), ) ```

[!IMPORTANT]
The templates used in those widgets are using bootstrap5 classes so ideally those widgets are used with django-crispy-forms and crispy-bootstrap5

Owner

  • Name: Austrian Centre for Digital Humanities & Cultural Heritage
  • Login: acdh-oeaw
  • Kind: organization
  • Email: acdh@oeaw.ac.at
  • Location: Vienna, Austria

GitHub Events

Total
  • Release event: 1
  • Push event: 3
  • Create event: 3
Last Year
  • Release event: 1
  • Push event: 3
  • Create event: 3

Issues and Pull Requests

Last synced: about 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

.github/workflows/lint.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
  • py-actions/flake8 v2 composite
.github/workflows/pypi.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
pyproject.toml pypi
  • django >=5
  • django-filter *
requirements.txt pypi
  • black *
  • build *
  • flake8 *
  • setuptools *
  • twine *