commonground-api-common 2.6.1__py3-none-any.whl → 2.6.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: commonground-api-common
3
- Version: 2.6.1
3
+ Version: 2.6.3
4
4
  Summary: Commonground API tooling
5
5
  Home-page: https://github.com/maykinmedia/commonground-api-common
6
6
  Author: Maykin Media, VNG-Realisatie
@@ -27,7 +27,7 @@ Requires-Dist: djangorestframework_camel_case>=1.2.0
27
27
  Requires-Dist: django-rest-framework-condition
28
28
  Requires-Dist: drf-nested-routers>=0.94.1
29
29
  Requires-Dist: drf-spectacular
30
- Requires-Dist: iso-639
30
+ Requires-Dist: iso639-lang
31
31
  Requires-Dist: notifications-api-common>=0.3.1
32
32
  Requires-Dist: zgw-consumers>=0.35.1
33
33
  Requires-Dist: oyaml
@@ -1,5 +1,5 @@
1
- commonground_api_common-2.6.1.data/scripts/generate_schema,sha256=OpKgzlFc_uzA3TVW_vHSYXAD_feLaCdTEnkWjIcxVzA,280
2
- vng_api_common/__init__.py,sha256=yv0wJuq7dd_PlBhLN8iuPUYVsoACKuk2R3Gg5WU-tHk,22
1
+ commonground_api_common-2.6.3.data/scripts/generate_schema,sha256=OpKgzlFc_uzA3TVW_vHSYXAD_feLaCdTEnkWjIcxVzA,280
2
+ vng_api_common/__init__.py,sha256=uJ6TLK18jhCrL0aclBja7NzlAGLAyZjVpX-gq3d461k,22
3
3
  vng_api_common/admin.py,sha256=iFtUPGf-ha0I-bXgq8QIFrP23Kzk_H3FlgAjt0U-ip0,259
4
4
  vng_api_common/apps.py,sha256=QQiJXRmjX9Q91oh0P9fvVnHe3NSYd1cEcUUBw0HLBCA,3690
5
5
  vng_api_common/checks.py,sha256=tOyfV7MMLGh4anrd_W30LvJCxiyQ4sFs1mGd9mtrEc0,1175
@@ -12,16 +12,16 @@ vng_api_common/descriptors.py,sha256=RFOqnDn5PEX0-qXb_r4_9wdEvuck5wNxT4tcrP95KaE
12
12
  vng_api_common/doc.py,sha256=a4Wm6Y-Va-tBsLwZFjPX_oA4PppkDR4wpIiw9q7NLd4,1167
13
13
  vng_api_common/exception_handling.py,sha256=Z8Si1-GPWaTtsgaFI_zLOvlnLVLM8jqfgFIimX8eo-8,4759
14
14
  vng_api_common/exceptions.py,sha256=7Qk5dlETjoQjZeGRKei4PkeLACLoZOMrMiuyi-yn6Kk,615
15
- vng_api_common/fields.py,sha256=1911m0CKEU-5-2t_h5P-D2YjC8BGosx8t8FQ-SGfgFw,6335
15
+ vng_api_common/fields.py,sha256=SXY0HB9NiDVmlKdjBDy3b55E4rn-qboiIMBr_eOBuZE,6302
16
16
  vng_api_common/filters.py,sha256=oPivwrES1BQgSUg1jD9hJab7dyoO3VbZDVbbRRiW2SQ,5618
17
- vng_api_common/filtersets.py,sha256=Ioarp5t_cz6Hf3iIcP2Rc0D7tGYhcMQPVdIJJ2dvtv8,867
17
+ vng_api_common/filtersets.py,sha256=CpmuOg6jGKFDwVeCusax-CBI7tv-EuOSBLwewdkLu1Y,1256
18
18
  vng_api_common/generators.py,sha256=88yQN5-vRFUegfzQcsZtlpbtQyn_zZQwvs20OidPK7M,1239
19
19
  vng_api_common/geo.py,sha256=AZbrw0rwGYOmaSUk8JJSkx-4_tVrfT_cgggh9omRwhU,1862
20
20
  vng_api_common/middleware.py,sha256=2DRw0hPpvUMqwoH1Ze8S7tDB16lmj4Bnd6vN5ijkGM8,875
21
21
  vng_api_common/mocks.py,sha256=0sELLs-uy2ndu29m5P6FN_p1ehNhYv7IoRayYPs379Y,6200
22
22
  vng_api_common/models.py,sha256=3WgpCWQpkCOrMCtqp7EbnP681II43Sg_cch8ZOm4EcU,1707
23
23
  vng_api_common/oas.py,sha256=ATqqNM7zkDMoK3E-cxNh_c65n6YCrP96KxCFYfkEVK0,2523
24
- vng_api_common/pagination.py,sha256=H-GPyDhM3KnxXk44__JLipvTghXQNqr3Rp6XFrkP32w,528
24
+ vng_api_common/pagination.py,sha256=U2zojaSHgEIzCEMBzx9r3KLpAujMCdM0ndH3AT6ik1U,734
25
25
  vng_api_common/permissions.py,sha256=ayDxk9Wt8j0yO57FhZ8XaRkPET4lAqd8SSw3m4o3EGs,7562
26
26
  vng_api_common/polymorphism.py,sha256=N-x39pG2unD4N0ZbxFvuhE8ibPaJ0eKeqfvAJW3NnEU,6623
27
27
  vng_api_common/routers.py,sha256=hEnhBulkgMM-7W_lYaykKTgTBj3-avl7DGsR9P7BbTU,1897
@@ -183,7 +183,7 @@ vng_api_common/tests/auth.py,sha256=IKDWTEFv4Bign4F70-ibsFcnJqRxEJaXvqaPQJWa1xY,
183
183
  vng_api_common/tests/caching.py,sha256=zfIw5cRRvO9cekHZZKfRqZc8cx5IfJUYNmcH6cuIMg4,624
184
184
  vng_api_common/tests/schema.py,sha256=WDvifDQQiKqIpQijpeQ7rYkFroJmuPuHe7zNhl1Bigk,2293
185
185
  vng_api_common/tests/urls.py,sha256=PFrYzQbBC0TFPMEn3uPhcBG0IQs9JsEPqckicJT1UA4,2159
186
- commonground_api_common-2.6.1.dist-info/METADATA,sha256=TCEnYBoRYR_1qTBTE73HroD-J4mDJEHuZOeROVkAcvo,6965
187
- commonground_api_common-2.6.1.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
188
- commonground_api_common-2.6.1.dist-info/top_level.txt,sha256=vPismc83zPzWXTmlNCCwfDlFV9iygJYxNJW5iDjKTgw,15
189
- commonground_api_common-2.6.1.dist-info/RECORD,,
186
+ commonground_api_common-2.6.3.dist-info/METADATA,sha256=xAiksqZyWhVPcglOXU0hf8Mh6YvvTDOsbuRGrZdHlAY,6969
187
+ commonground_api_common-2.6.3.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
188
+ commonground_api_common-2.6.3.dist-info/top_level.txt,sha256=vPismc83zPzWXTmlNCCwfDlFV9iygJYxNJW5iDjKTgw,15
189
+ commonground_api_common-2.6.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.0)
2
+ Generator: setuptools (80.4.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1 +1 @@
1
- __version__ = "2.6.1"
1
+ __version__ = "2.6.3"
vng_api_common/fields.py CHANGED
@@ -5,16 +5,12 @@ from django.core.validators import MaxValueValidator, MinValueValidator
5
5
  from django.db import models
6
6
  from django.utils.translation import gettext, gettext_lazy as _
7
7
 
8
- from iso639 import languages
8
+ from iso639 import iter_langs
9
9
 
10
10
  from .constants import BSN_LENGTH, RSIN_LENGTH, VertrouwelijkheidsAanduiding
11
- from .validators import validate_rsin
11
+ from .validators import validate_bsn, validate_rsin
12
12
 
13
- ISO_639_2B = languages.part2b
14
-
15
- LANGUAGE_CHOICES = tuple(
16
- [(code, language.name) for code, language in ISO_639_2B.items()]
17
- )
13
+ LANGUAGE_CHOICES = tuple([(lg.pt2b, lg.name) for lg in iter_langs() if lg.pt2b])
18
14
 
19
15
 
20
16
  class RSINField(models.CharField):
@@ -43,7 +39,7 @@ class RSINField(models.CharField):
43
39
 
44
40
 
45
41
  class BSNField(models.CharField):
46
- default_validators = [validate_rsin]
42
+ default_validators = [validate_bsn]
47
43
  description = _("BSN")
48
44
 
49
45
  def __init__(self, *args, **kwargs):
@@ -25,3 +25,13 @@ class FilterSet(filterset.FilterSet):
25
25
  """
26
26
 
27
27
  FILTER_DEFAULTS = FILTER_FOR_DBFIELD_DEFAULTS
28
+
29
+ @classmethod
30
+ def filter_for_field(cls, field, field_name, lookup_expr=None):
31
+ """
32
+ Add help texts for model field filters
33
+ """
34
+ filter_set = super().filter_for_field(field, field_name, lookup_expr)
35
+ if not filter_set.extra.get("help_text"):
36
+ filter_set.extra["help_text"] = getattr(field, "help_text", None)
37
+ return filter_set
@@ -14,5 +14,11 @@ class DynamicPageSizeMixin:
14
14
  page_size_query_param = "pageSize"
15
15
  max_page_size = 500
16
16
 
17
+ @property
18
+ def page_size_query_description(self):
19
+ return _(
20
+ "Het aantal resultaten terug te geven per pagina. (default: {page_size})."
21
+ ).format(page_size=self.page_size)
22
+
17
23
 
18
24
  class DynamicPageSizePagination(DynamicPageSizeMixin, PageNumberPagination): ...