Skip to content

Commit

Permalink
♻️ [#2193] Replace django-better-admin-arrayfield with django-jsonform
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbal committed Mar 12, 2024
1 parent 7cee4ed commit 38043d8
Show file tree
Hide file tree
Showing 24 changed files with 38 additions and 50 deletions.
2 changes: 1 addition & 1 deletion requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ django-colorfield
django-registration
django-view-breadcrumbs
markdown
django_better_admin_arrayfield
django-jsonform
humanfriendly
git+https://github.com/maykinmedia/[email protected]#egg=mail-editor
fontawesomefree
Expand Down
6 changes: 3 additions & 3 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ django-autoslug==1.9.8
# via -r requirements/base.in
django-axes==5.25.0
# via -r requirements/base.in
django-better-admin-arrayfield==1.4.2
# via -r requirements/base.in
django-choices==2.0.0
# via mail-editor
django-ckeditor==6.7.0
Expand Down Expand Up @@ -201,7 +199,9 @@ django-ipware==4.0.0
django-js-asset==2.2.0
# via django-ckeditor
django-jsonform==2.22.0
# via mozilla-django-oidc-db
# via
# -r requirements/base.in
# mozilla-django-oidc-db
django-localflavor==3.1
# via -r requirements/base.in
django-log-outgoing-requests==0.6.1
Expand Down
4 changes: 0 additions & 4 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,6 @@ django-axes==5.25.0
# via
# -c requirements/base.txt
# -r requirements/base.txt
django-better-admin-arrayfield==1.4.2
# via
# -c requirements/base.txt
# -r requirements/base.txt
django-choices==2.0.0
# via
# -c requirements/base.txt
Expand Down
4 changes: 0 additions & 4 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,6 @@ django-axes==5.25.0
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
django-better-admin-arrayfield==1.4.2
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
django-choices==2.0.0
# via
# -c requirements/ci.txt
Expand Down
3 changes: 1 addition & 2 deletions src/digid_eherkenning_oidc_generics/admin.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
from django.contrib import admin
from django.utils.translation import gettext_lazy as _

from django_better_admin_arrayfield.admin.mixins import DynamicArrayMixin
from solo.admin import SingletonModelAdmin

from .forms import OpenIDConnectDigiDConfigForm, OpenIDConnectEHerkenningConfigForm
from .models import OpenIDConnectDigiDConfig, OpenIDConnectEHerkenningConfig


class OpenIDConnectConfigBaseAdmin(DynamicArrayMixin, SingletonModelAdmin):
class OpenIDConnectConfigBaseAdmin(SingletonModelAdmin):
fieldsets = (
(
_("Activation"),
Expand Down
10 changes: 5 additions & 5 deletions src/digid_eherkenning_oidc_generics/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import digid_eherkenning_oidc_generics.models
from django.db import migrations, models
import django_better_admin_arrayfield.models.fields
import django_jsonform.models.fields
import mozilla_django_oidc_db.models


Expand Down Expand Up @@ -127,7 +127,7 @@ class Migration(migrations.Migration):
),
(
"oidc_exempt_urls",
django_better_admin_arrayfield.models.fields.ArrayField(
django_jsonform.models.fields.ArrayField(
base_field=models.CharField(
max_length=1000, verbose_name="Exempt URL"
),
Expand Down Expand Up @@ -188,7 +188,7 @@ class Migration(migrations.Migration):
),
(
"oidc_rp_scopes_list",
django_better_admin_arrayfield.models.fields.ArrayField(
django_jsonform.models.fields.ArrayField(
base_field=models.CharField(
max_length=50, verbose_name="OpenID Connect scope"
),
Expand Down Expand Up @@ -319,7 +319,7 @@ class Migration(migrations.Migration):
),
(
"oidc_exempt_urls",
django_better_admin_arrayfield.models.fields.ArrayField(
django_jsonform.models.fields.ArrayField(
base_field=models.CharField(
max_length=1000, verbose_name="Exempt URL"
),
Expand Down Expand Up @@ -380,7 +380,7 @@ class Migration(migrations.Migration):
),
(
"oidc_rp_scopes_list",
django_better_admin_arrayfield.models.fields.ArrayField(
django_jsonform.models.fields.ArrayField(
base_field=models.CharField(
max_length=50, verbose_name="OpenID Connect scope"
),
Expand Down
2 changes: 1 addition & 1 deletion src/digid_eherkenning_oidc_generics/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.utils.functional import classproperty
from django.utils.translation import gettext_lazy as _

from django_better_admin_arrayfield.models.fields import ArrayField
from django_jsonform.models.fields import ArrayField
from mozilla_django_oidc_db.models import CachingMixin, OpenIDConnectConfigBase

from .digid_settings import DIGID_CUSTOM_OIDC_DB_PREFIX
Expand Down
1 change: 0 additions & 1 deletion src/open_inwoner/conf/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@
"solo",
"colorfield",
"view_breadcrumbs",
"django_better_admin_arrayfield",
"django_jsonform",
"simple_certmanager",
"zgw_consumers",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated by Django 3.2.23 on 2024-01-22 10:18

from django.db import migrations, models
import django_better_admin_arrayfield.models.fields
import django_jsonform.models.fields


class Migration(migrations.Migration):
Expand All @@ -14,7 +14,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name="siteconfiguration",
name="recipients_email_digest",
field=django_better_admin_arrayfield.models.fields.ArrayField(
field=django_jsonform.models.fields.ArrayField(
base_field=models.EmailField(max_length=254),
blank=True,
default=list,
Expand Down
2 changes: 1 addition & 1 deletion src/open_inwoner/configurations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from django.utils.translation import gettext_lazy as _

from colorfield.fields import ColorField
from django_better_admin_arrayfield.models.fields import ArrayField
from django_jsonform.models.fields import ArrayField
from filer.fields.image import FilerImageField
from ordered_model.models import OrderedModel, OrderedModelManager
from solo.models import SingletonModel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated by Django 3.2.15 on 2023-01-23 15:19

from django.db import migrations, models
import django_better_admin_arrayfield.models.fields
import django_jsonform.models.fields


class Migration(migrations.Migration):
Expand All @@ -14,7 +14,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name="openzaakconfig",
name="allowed_file_extensions",
field=django_better_admin_arrayfield.models.fields.ArrayField(
field=django_jsonform.models.fields.ArrayField(
base_field=models.CharField(
max_length=8, verbose_name="Allowed file extensions"
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated by Django 3.2.15 on 2023-01-25 10:12

from django.db import migrations, models
import django_better_admin_arrayfield.models.fields
import django_jsonform.models.fields
import open_inwoner.openzaak.models


Expand All @@ -15,7 +15,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name="openzaakconfig",
name="allowed_file_extensions",
field=django_better_admin_arrayfield.models.fields.ArrayField(
field=django_jsonform.models.fields.ArrayField(
base_field=models.CharField(
max_length=8, verbose_name="Allowed file extensions"
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import django.db.models.deletion
from django.db import migrations, models

import django_better_admin_arrayfield.models.fields
import django_jsonform.models.fields


class Migration(migrations.Migration):
Expand Down Expand Up @@ -49,7 +49,7 @@ class Migration(migrations.Migration):
),
(
"zaaktype_uuids",
django_better_admin_arrayfield.models.fields.ArrayField(
django_jsonform.models.fields.ArrayField(
base_field=models.UUIDField(verbose_name="Zaaktype UUID"),
default=list,
size=None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django.db import migrations, models
import django.db.models.deletion
import django_better_admin_arrayfield.models.fields
import django_jsonform.models.fields


class Migration(migrations.Migration):
Expand Down Expand Up @@ -38,7 +38,7 @@ class Migration(migrations.Migration):
),
(
"zaaktype_uuids",
django_better_admin_arrayfield.models.fields.ArrayField(
django_jsonform.models.fields.ArrayField(
base_field=models.UUIDField(verbose_name="Zaaktype UUID"),
default=list,
size=None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django.db import migrations, models
import django.db.models.deletion
import django_better_admin_arrayfield.models.fields
import django_jsonform.models.fields


class Migration(migrations.Migration):
Expand Down Expand Up @@ -34,7 +34,7 @@ class Migration(migrations.Migration):
),
(
"zaaktype_uuids",
django_better_admin_arrayfield.models.fields.ArrayField(
django_jsonform.models.fields.ArrayField(
base_field=models.UUIDField(verbose_name="Zaaktype UUID"),
default=list,
size=None,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated by Django 3.2.20 on 2023-11-20 10:06

from django.db import migrations, models
import django_better_admin_arrayfield.models.fields
import django_jsonform.models.fields


class Migration(migrations.Migration):
Expand All @@ -14,7 +14,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name="zaaktypeconfig",
name="urls",
field=django_better_admin_arrayfield.models.fields.ArrayField(
field=django_jsonform.models.fields.ArrayField(
base_field=models.URLField(verbose_name="Zaaktype URL"),
default=list,
size=None,
Expand Down
2 changes: 1 addition & 1 deletion src/open_inwoner/openzaak/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from django.utils import timezone
from django.utils.translation import gettext_lazy as _

from django_better_admin_arrayfield.models.fields import ArrayField
from django_jsonform.models.fields import ArrayField
from furl import furl
from solo.models import SingletonModel
from zgw_consumers.api_models.constants import VertrouwelijkheidsAanduidingen
Expand Down
5 changes: 2 additions & 3 deletions src/open_inwoner/pdc/admin/category.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
from django.forms import BaseModelFormSet
from django.utils.translation import gettext as _

from django_better_admin_arrayfield.admin.mixins import DynamicArrayMixin
from django_better_admin_arrayfield.forms.widgets import DynamicArrayWidget
from django_jsonform.widgets import JSONFormWidget
from import_export.admin import ImportExportMixin
from import_export.formats import base_formats
from ordered_model.admin import OrderedInlineModelAdminMixin, OrderedTabularInline
Expand Down Expand Up @@ -49,7 +48,7 @@ def __init__(self, *args, **kwargs):
self.choices = choices_dict.items()


class DynamicArraySelectWidget(DynamicArrayWidget):
class DynamicArraySelectWidget(JSONFormWidget):
def __init__(self, *args, **kwargs):
kwargs["subwidget_form"] = ZaakTypenSelectWidget

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated by Django 3.2.20 on 2023-11-13 10:55

from django.db import migrations, models
import django_better_admin_arrayfield.models.fields
import django_jsonform.models.fields


class Migration(migrations.Migration):
Expand All @@ -14,7 +14,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name="category",
name="zaaktypen",
field=django_better_admin_arrayfield.models.fields.ArrayField(
field=django_jsonform.models.fields.ArrayField(
base_field=models.CharField(blank=True, max_length=1000),
blank=True,
default=list,
Expand Down
2 changes: 1 addition & 1 deletion src/open_inwoner/pdc/models/category.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.urls import reverse
from django.utils.translation import gettext_lazy as _

from django_better_admin_arrayfield.models.fields import ArrayField
from django_jsonform.models.fields import ArrayField
from filer.fields.image import FilerImageField
from treebeard.exceptions import InvalidMoveToDescendant
from treebeard.mp_tree import MP_MoveHandler, MP_Node
Expand Down
3 changes: 1 addition & 2 deletions src/open_inwoner/search/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from django.utils.html import format_html
from django.utils.translation import gettext_lazy as _

from django_better_admin_arrayfield.admin.mixins import DynamicArrayMixin
from import_export.admin import ImportExportMixin
from import_export.formats import base_formats

Expand All @@ -12,7 +11,7 @@


@admin.register(Synonym)
class SynonymAdmin(ImportExportMixin, admin.ModelAdmin, DynamicArrayMixin):
class SynonymAdmin(ImportExportMixin, admin.ModelAdmin):
list_display = ("term", "synonyms")
resource_class = SynonymResource
formats = [base_formats.CSV]
Expand Down
4 changes: 2 additions & 2 deletions src/open_inwoner/search/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django.db import migrations, models

import django_better_admin_arrayfield.models.fields
import django_jsonform.models.fields


class Migration(migrations.Migration):
Expand Down Expand Up @@ -35,7 +35,7 @@ class Migration(migrations.Migration):
),
(
"synonyms",
django_better_admin_arrayfield.models.fields.ArrayField(
django_jsonform.models.fields.ArrayField(
base_field=models.TextField(verbose_name="synonyms"),
help_text="Words-synonyms concerning the term",
size=None,
Expand Down
4 changes: 2 additions & 2 deletions src/open_inwoner/search/migrations/0003_auto_20220218_1359.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from django.conf import settings
from django.db import migrations, models

import django_better_admin_arrayfield.models.fields
import django_jsonform.models.fields


class Migration(migrations.Migration):
Expand Down Expand Up @@ -77,7 +77,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name="synonym",
name="synonyms",
field=django_better_admin_arrayfield.models.fields.ArrayField(
field=django_jsonform.models.fields.ArrayField(
base_field=models.TextField(verbose_name="Synonyms"),
help_text="Words-synonyms concerning the term",
size=None,
Expand Down
2 changes: 1 addition & 1 deletion src/open_inwoner/search/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.db.models.deletion import CASCADE
from django.utils.translation import gettext_lazy as _

from django_better_admin_arrayfield.models.fields import ArrayField
from django_jsonform.models.fields import ArrayField

from .query import FieldBoostQueryset

Expand Down

0 comments on commit 38043d8

Please sign in to comment.