%global _empty_manifest_terminate_build 0 Name: python-django-durationwidget Version: 1.0.5 Release: 1 Summary: Django Duration field widget to handle duration field in the form License: MIT License URL: https://github.com/devangpadhiyar/django-durationwidget Source0: https://mirrors.nju.edu.cn/pypi/web/packages/11/7a/12e987f4b7ea57fb3d66997984b6863af45fd5fb326bfea47904aa27a607/django-durationwidget-1.0.5.tar.gz BuildArch: noarch Requires: python3-Django %description # Django Duration Widget ### When to use? You can find duration field as below which is not far good for humans to use. ![Duration](/docs/duration.png) Django duration widget is used for simplfiend Django model's `Duration` field. ### Quick start 1. Install `django-durationwidget` using `pip` `pip install django-durationwidget` 2. Add `durationwidget` to your `INSTALLED_APPS` setting like this:: ```python INSTALLED_APPS = [ ... 'durationwidget', ] ``` 3. Make sure to set `APP_DIRS` to `True` in settings.py ```python TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [ os.path.join(BASE_DIR, 'templates'), ... ], 'APP_DIRS': True, # Setup this to True 'OPTIONS': { ... }, }, ] ``` 4. Cheer up you are ready to use `TimeDurationWidget` as normal widget as below. ```python from django import forms from durationwidget.widgets import TimeDurationWidget from .models import YourModel class CustomForm(forms.ModelForm): ... duration = forms.DurationField(widget=TimeDurationWidget(), required=False) class Meta: model = YourModel ... ``` It will render Duration field as below ![Duration field](/docs/duration_final.png) ## TimeDurationWidget ```python duration = forms.DurationField(widget=TimeDurationWidget( show_days=True, show_hours=True, show_minutes=True, show_seconds=True ), required=False) ``` Following keyword argument can be passed to show/ hide fields in duration widget. > By default all keyword arguments are set to `True` `show_days` : To display/ hide days field in widget
`show_hours` : To display/ hide hours field in widget
`show_minutes` : To display/ hide minutes field in widget
`show_seconds` : To display/ hide seconds field in widget
%package -n python3-django-durationwidget Summary: Django Duration field widget to handle duration field in the form Provides: python-django-durationwidget BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-django-durationwidget # Django Duration Widget ### When to use? You can find duration field as below which is not far good for humans to use. ![Duration](/docs/duration.png) Django duration widget is used for simplfiend Django model's `Duration` field. ### Quick start 1. Install `django-durationwidget` using `pip` `pip install django-durationwidget` 2. Add `durationwidget` to your `INSTALLED_APPS` setting like this:: ```python INSTALLED_APPS = [ ... 'durationwidget', ] ``` 3. Make sure to set `APP_DIRS` to `True` in settings.py ```python TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [ os.path.join(BASE_DIR, 'templates'), ... ], 'APP_DIRS': True, # Setup this to True 'OPTIONS': { ... }, }, ] ``` 4. Cheer up you are ready to use `TimeDurationWidget` as normal widget as below. ```python from django import forms from durationwidget.widgets import TimeDurationWidget from .models import YourModel class CustomForm(forms.ModelForm): ... duration = forms.DurationField(widget=TimeDurationWidget(), required=False) class Meta: model = YourModel ... ``` It will render Duration field as below ![Duration field](/docs/duration_final.png) ## TimeDurationWidget ```python duration = forms.DurationField(widget=TimeDurationWidget( show_days=True, show_hours=True, show_minutes=True, show_seconds=True ), required=False) ``` Following keyword argument can be passed to show/ hide fields in duration widget. > By default all keyword arguments are set to `True` `show_days` : To display/ hide days field in widget
`show_hours` : To display/ hide hours field in widget
`show_minutes` : To display/ hide minutes field in widget
`show_seconds` : To display/ hide seconds field in widget
%package help Summary: Development documents and examples for django-durationwidget Provides: python3-django-durationwidget-doc %description help # Django Duration Widget ### When to use? You can find duration field as below which is not far good for humans to use. ![Duration](/docs/duration.png) Django duration widget is used for simplfiend Django model's `Duration` field. ### Quick start 1. Install `django-durationwidget` using `pip` `pip install django-durationwidget` 2. Add `durationwidget` to your `INSTALLED_APPS` setting like this:: ```python INSTALLED_APPS = [ ... 'durationwidget', ] ``` 3. Make sure to set `APP_DIRS` to `True` in settings.py ```python TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [ os.path.join(BASE_DIR, 'templates'), ... ], 'APP_DIRS': True, # Setup this to True 'OPTIONS': { ... }, }, ] ``` 4. Cheer up you are ready to use `TimeDurationWidget` as normal widget as below. ```python from django import forms from durationwidget.widgets import TimeDurationWidget from .models import YourModel class CustomForm(forms.ModelForm): ... duration = forms.DurationField(widget=TimeDurationWidget(), required=False) class Meta: model = YourModel ... ``` It will render Duration field as below ![Duration field](/docs/duration_final.png) ## TimeDurationWidget ```python duration = forms.DurationField(widget=TimeDurationWidget( show_days=True, show_hours=True, show_minutes=True, show_seconds=True ), required=False) ``` Following keyword argument can be passed to show/ hide fields in duration widget. > By default all keyword arguments are set to `True` `show_days` : To display/ hide days field in widget
`show_hours` : To display/ hide hours field in widget
`show_minutes` : To display/ hide minutes field in widget
`show_seconds` : To display/ hide seconds field in widget
%prep %autosetup -n django-durationwidget-1.0.5 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-django-durationwidget -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Fri May 05 2023 Python_Bot - 1.0.5-1 - Package Spec generated