diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-django-fieldsets-with-inlines.spec | 285 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 287 insertions, 0 deletions
@@ -0,0 +1 @@ +/django_fieldsets_with_inlines-0.6.tar.gz diff --git a/python-django-fieldsets-with-inlines.spec b/python-django-fieldsets-with-inlines.spec new file mode 100644 index 0000000..7021ac5 --- /dev/null +++ b/python-django-fieldsets-with-inlines.spec @@ -0,0 +1,285 @@ +%global _empty_manifest_terminate_build 0 +Name: python-django-fieldsets-with-inlines +Version: 0.6 +Release: 1 +Summary: Mixin inlines and fieldsets in Django admin. +License: MIT +URL: https://github.com/robertkovac/django-fieldsets-with-inlines +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/1c/71/d4c5e0ac11afd144e4842598c706901dc5d66a62ab37f8a9c87b6b410c40/django_fieldsets_with_inlines-0.6.tar.gz +BuildArch: noarch + + +%description +# Fieldsets with inlines +### Mix inlines and fieldsets in any order in Django admin. + +## What is it? + +Django administration has nice feature to render related models as inlines +**under** the fieldsets out of the box. Unfortunately there is no easy +way to render inlines between fieldsets. + +But when the size of the model becomes bigger, ordering of fieldsets and +related inlines becomes critical for the usability. + +This package makes it easy to mix fieldsets and inlines in any order +you want with minimal changes required to your existing code. + + +## Requirements + +- Python: 3.4+ +- Django: 2.0+ + +## Installation + +``` +pip install django-fieldsets-with-inlines +``` + +Add `fieldsets_with_inlines` to your INSTALLED_APPS Django settings.py: + +```python +INSTALLED_APPS = [ + ... + 'fieldsets_with_inlines', + ... +] +``` + +## Usage + +In your `admin.py` import `FieldsetsInlineMixin`, rename `fieldsets` +property to `fieldsets_with_inlines` and list inlines right between your +fieldsets. You could also remove `inlines` property: + + +```python +from fieldsets_with_inlines import FieldsetsInlineMixin + +... + +class TestAdmin(FieldsetsInlineMixin, admin.ModelAdmin): + fieldsets_with_inlines = [ + ('Objekt', { + 'fields': [ + ('ID_RNO', 'id', 'kljuc', 'slug'), + 'naziv', + 'kategorija']}), + LastnistvoInline, + ('Kontaktni podatki', { + 'fields': [ + ('kontaktna_oseba', 'email', 'poslji_obvestila')]}), + KontaktInline, + ('Dostop', { + 'fields': [ + 'users', + ('cas_vpisa', 'zadnja_sprememba', 'cas_zadnje_posodobitve')]}), + OdjavaInline + ] +``` + + + + + +%package -n python3-django-fieldsets-with-inlines +Summary: Mixin inlines and fieldsets in Django admin. +Provides: python-django-fieldsets-with-inlines +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-django-fieldsets-with-inlines +# Fieldsets with inlines +### Mix inlines and fieldsets in any order in Django admin. + +## What is it? + +Django administration has nice feature to render related models as inlines +**under** the fieldsets out of the box. Unfortunately there is no easy +way to render inlines between fieldsets. + +But when the size of the model becomes bigger, ordering of fieldsets and +related inlines becomes critical for the usability. + +This package makes it easy to mix fieldsets and inlines in any order +you want with minimal changes required to your existing code. + + +## Requirements + +- Python: 3.4+ +- Django: 2.0+ + +## Installation + +``` +pip install django-fieldsets-with-inlines +``` + +Add `fieldsets_with_inlines` to your INSTALLED_APPS Django settings.py: + +```python +INSTALLED_APPS = [ + ... + 'fieldsets_with_inlines', + ... +] +``` + +## Usage + +In your `admin.py` import `FieldsetsInlineMixin`, rename `fieldsets` +property to `fieldsets_with_inlines` and list inlines right between your +fieldsets. You could also remove `inlines` property: + + +```python +from fieldsets_with_inlines import FieldsetsInlineMixin + +... + +class TestAdmin(FieldsetsInlineMixin, admin.ModelAdmin): + fieldsets_with_inlines = [ + ('Objekt', { + 'fields': [ + ('ID_RNO', 'id', 'kljuc', 'slug'), + 'naziv', + 'kategorija']}), + LastnistvoInline, + ('Kontaktni podatki', { + 'fields': [ + ('kontaktna_oseba', 'email', 'poslji_obvestila')]}), + KontaktInline, + ('Dostop', { + 'fields': [ + 'users', + ('cas_vpisa', 'zadnja_sprememba', 'cas_zadnje_posodobitve')]}), + OdjavaInline + ] +``` + + + + + +%package help +Summary: Development documents and examples for django-fieldsets-with-inlines +Provides: python3-django-fieldsets-with-inlines-doc +%description help +# Fieldsets with inlines +### Mix inlines and fieldsets in any order in Django admin. + +## What is it? + +Django administration has nice feature to render related models as inlines +**under** the fieldsets out of the box. Unfortunately there is no easy +way to render inlines between fieldsets. + +But when the size of the model becomes bigger, ordering of fieldsets and +related inlines becomes critical for the usability. + +This package makes it easy to mix fieldsets and inlines in any order +you want with minimal changes required to your existing code. + + +## Requirements + +- Python: 3.4+ +- Django: 2.0+ + +## Installation + +``` +pip install django-fieldsets-with-inlines +``` + +Add `fieldsets_with_inlines` to your INSTALLED_APPS Django settings.py: + +```python +INSTALLED_APPS = [ + ... + 'fieldsets_with_inlines', + ... +] +``` + +## Usage + +In your `admin.py` import `FieldsetsInlineMixin`, rename `fieldsets` +property to `fieldsets_with_inlines` and list inlines right between your +fieldsets. You could also remove `inlines` property: + + +```python +from fieldsets_with_inlines import FieldsetsInlineMixin + +... + +class TestAdmin(FieldsetsInlineMixin, admin.ModelAdmin): + fieldsets_with_inlines = [ + ('Objekt', { + 'fields': [ + ('ID_RNO', 'id', 'kljuc', 'slug'), + 'naziv', + 'kategorija']}), + LastnistvoInline, + ('Kontaktni podatki', { + 'fields': [ + ('kontaktna_oseba', 'email', 'poslji_obvestila')]}), + KontaktInline, + ('Dostop', { + 'fields': [ + 'users', + ('cas_vpisa', 'zadnja_sprememba', 'cas_zadnje_posodobitve')]}), + OdjavaInline + ] +``` + + + + + +%prep +%autosetup -n django-fieldsets-with-inlines-0.6 + +%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-fieldsets-with-inlines -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 17 2023 Python_Bot <Python_Bot@openeuler.org> - 0.6-1 +- Package Spec generated @@ -0,0 +1 @@ +3acd7005ca6b9325549b97e4b79310fa django_fieldsets_with_inlines-0.6.tar.gz |