From f075aabd4ff705eebeb16676fdd13295cffee8a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s-Combarro=20=27piranna?= Date: Fri, 16 Feb 2024 07:28:26 +0100 Subject: [PATCH 01/15] Raise proper exception if no child models are available --- polymorphic/admin/parentadmin.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/polymorphic/admin/parentadmin.py b/polymorphic/admin/parentadmin.py index d021522d..b96dc2bd 100644 --- a/polymorphic/admin/parentadmin.py +++ b/polymorphic/admin/parentadmin.py @@ -123,9 +123,14 @@ def get_child_type_choices(self, request, action): Return a list of polymorphic types for which the user has the permission to perform the given action. """ self._lazy_setup() + + child_models = self.get_child_models() + if not child_models: + raise ImproperlyConfigured("No child models are available.") + choices = [] content_types = ContentType.objects.get_for_models( - *self.get_child_models(), for_concrete_models=False + *child_models, for_concrete_models=False ) for model, ct in content_types.items(): From d12eccf46636d01214eb69c07b8406c1528d4f2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s-Combarro=20=27piranna?= Date: Thu, 29 Feb 2024 10:34:08 +0100 Subject: [PATCH 02/15] Auto-discover child models by default --- polymorphic/admin/helpers.py | 17 +++++++++++++++++ polymorphic/admin/parentadmin.py | 16 +++++++++++++--- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/polymorphic/admin/helpers.py b/polymorphic/admin/helpers.py index bb5b80d7..98035b4d 100644 --- a/polymorphic/admin/helpers.py +++ b/polymorphic/admin/helpers.py @@ -62,6 +62,7 @@ def __iter__(self): for form in self.formset.extra_forms + self.formset.empty_forms: model = form._meta.model child_inline = self.opts.get_child_inline_instance(model) + yield PolymorphicInlineAdminForm( formset=self.formset, form=form, @@ -140,3 +141,19 @@ def get_inline_formsets(self, request, formsets, inline_instances, obj=None, *ar admin_formset.request = request admin_formset.obj = obj return inline_admin_formsets + + +def get_leaf_subclasses(cls): + "Get leaf subclasses of `cls` class" + + result = [] + + subclasses = cls.__subclasses__() + + if not subclasses: + result.append(cls) + else: + for subclass in subclasses: + result.extend(get_leaf_subclasses(subclass)) + + return result diff --git a/polymorphic/admin/parentadmin.py b/polymorphic/admin/parentadmin.py index b96dc2bd..14728829 100644 --- a/polymorphic/admin/parentadmin.py +++ b/polymorphic/admin/parentadmin.py @@ -18,6 +18,7 @@ from polymorphic.utils import get_base_polymorphic_model from .forms import PolymorphicModelChoiceForm +from .helpers import get_leaf_subclasses class RegistrationClosed(RuntimeError): @@ -113,10 +114,19 @@ def get_child_models(self): The model classes can be retrieved as ``base_model.__subclasses__()``, a setting in a config file, or a query of a plugin registration system at your option """ - if self.child_models is None: - raise NotImplementedError("Implement get_child_models() or child_models") + if self.child_models is not None: + return self.child_models - return self.child_models + child_models = get_leaf_subclasses(self.base_model) + + if child_models: + return child_models + + raise ImproperlyConfigured( + "No child models found for '{self.base_model.__name__}', please " + "define the 'child_models' attribute or overwrite the " + "'get_child_models' method." + ) def get_child_type_choices(self, request, action): """ From 308f1d4c719fddb54bc3c27e272372b961582523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s-Combarro=20=27piranna?= Date: Thu, 29 Feb 2024 10:37:14 +0100 Subject: [PATCH 03/15] Auto-discover child inlines by default --- polymorphic/admin/inlines.py | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/polymorphic/admin/inlines.py b/polymorphic/admin/inlines.py index 39a1f71d..d4184e5d 100644 --- a/polymorphic/admin/inlines.py +++ b/polymorphic/admin/inlines.py @@ -19,7 +19,7 @@ ) from polymorphic.formsets.utils import add_media -from .helpers import PolymorphicInlineSupportMixin +from .helpers import PolymorphicInlineSupportMixin, get_leaf_subclasses class PolymorphicInlineModelAdmin(InlineModelAdmin): @@ -52,7 +52,7 @@ class PolymorphicInlineModelAdmin(InlineModelAdmin): #: Inlines for all model sub types that can be displayed in this inline. #: Each row is a :class:`PolymorphicInlineModelAdmin.Child` - child_inlines = () + child_inlines = None def __init__(self, parent_model, admin_site): super().__init__(parent_model, admin_site) @@ -76,12 +76,42 @@ def __init__(self, parent_model, admin_site): for child_inline in self.child_inline_instances: self._child_inlines_lookup[child_inline.model] = child_inline + def get_child_inlines(self): + """ + Return the derived inline classes which this admin should handle. + This should return a list of tuples, exactly like :attr:`child_inlines` is. + + The inline classes can be retrieved as ``base_inline.__subclasses__()``, + a setting in a config file, or a query of a plugin registration system at your option + """ + if self.child_inlines is not None: + return self.child_inlines + + child_inlines = get_leaf_subclasses(PolymorphicInlineModelAdmin.Child) + child_inlines = tuple( + inline + for inline in child_inlines + if ( + inline.model is not None and + issubclass(inline.model, self.model) + ) + ) + + if child_inlines: + return child_inlines + + raise ImproperlyConfigured( + "No child inlines found for '{self.model.__name__}', please " + "define the 'child_inlines' attribute or overwrite the " + "'get_child_inlines()' method." + ) + def get_child_inline_instances(self): """ :rtype List[PolymorphicInlineModelAdmin.Child] """ instances = [] - for ChildInlineType in self.child_inlines: + for ChildInlineType in self.get_child_inlines(): instances.append(ChildInlineType(parent_inline=self)) return instances From f8a93027cc9b9e2c26518d0b826c407285524ca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s-Combarro=20=27piranna?= Date: Tue, 5 Mar 2024 01:44:19 +0100 Subject: [PATCH 04/15] Fix string template --- polymorphic/admin/inlines.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/polymorphic/admin/inlines.py b/polymorphic/admin/inlines.py index d4184e5d..71ebab9a 100644 --- a/polymorphic/admin/inlines.py +++ b/polymorphic/admin/inlines.py @@ -101,9 +101,9 @@ def get_child_inlines(self): return child_inlines raise ImproperlyConfigured( - "No child inlines found for '{self.model.__name__}', please " - "define the 'child_inlines' attribute or overwrite the " - "'get_child_inlines()' method." + "No child inlines found for '{}', please define the " + "'child_inlines' attribute or overwrite the 'get_child_inlines()' " + "method.".format(self.model.__name__) ) def get_child_inline_instances(self): From 87e4b959dadf2b8df531ba1816a1aa3117411cca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s-Combarro=20=27piranna?= Date: Wed, 27 Mar 2024 14:07:20 +0100 Subject: [PATCH 05/15] Fix string template --- polymorphic/admin/inlines.py | 6 +++--- polymorphic/admin/parentadmin.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/polymorphic/admin/inlines.py b/polymorphic/admin/inlines.py index 3e08a8b7..e2cbffea 100644 --- a/polymorphic/admin/inlines.py +++ b/polymorphic/admin/inlines.py @@ -102,9 +102,9 @@ def get_child_inlines(self): return child_inlines raise ImproperlyConfigured( - "No child inlines found for '{}', please define the " - "'child_inlines' attribute or overwrite the 'get_child_inlines()' " - "method.".format(self.model.__name__) + f"No child inlines found for '{self.model.__name__}', please " + "define the 'child_inlines' attribute or overwrite the " + "'get_child_inlines()' method." ) def get_child_inline_instances(self): diff --git a/polymorphic/admin/parentadmin.py b/polymorphic/admin/parentadmin.py index af319bfc..340b90e1 100644 --- a/polymorphic/admin/parentadmin.py +++ b/polymorphic/admin/parentadmin.py @@ -124,7 +124,7 @@ def get_child_models(self): return child_models raise ImproperlyConfigured( - "No child models found for '{self.base_model.__name__}', please " + f"No child models found for '{self.base_model.__name__}', please " "define the 'child_models' attribute or overwrite the " "'get_child_models' method." ) From 0de8744621a99d0321078df52b7e4510d14ec6c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s-Combarro=20=27piranna?= Date: Wed, 27 Mar 2024 14:12:52 +0100 Subject: [PATCH 06/15] Adjust DocStrings to pep8 --- polymorphic/admin/inlines.py | 11 +++++++---- polymorphic/admin/parentadmin.py | 9 ++++++--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/polymorphic/admin/inlines.py b/polymorphic/admin/inlines.py index e2cbffea..455aea8d 100644 --- a/polymorphic/admin/inlines.py +++ b/polymorphic/admin/inlines.py @@ -79,11 +79,14 @@ def __init__(self, parent_model, admin_site): def get_child_inlines(self): """ - Return the derived inline classes which this admin should handle. - This should return a list of tuples, exactly like :attr:`child_inlines` is. + Return the derived inline classes which this admin should handle - The inline classes can be retrieved as ``base_inline.__subclasses__()``, - a setting in a config file, or a query of a plugin registration system at your option + This should return a list of tuples, exactly like + :attr:`child_inlines` is. + + The inline classes can be retrieved as + ``base_inline.__subclasses__()``, a setting in a config file, or + a query of a plugin registration system at your option """ if self.child_inlines is not None: return self.child_inlines diff --git a/polymorphic/admin/parentadmin.py b/polymorphic/admin/parentadmin.py index 340b90e1..cc8a193b 100644 --- a/polymorphic/admin/parentadmin.py +++ b/polymorphic/admin/parentadmin.py @@ -110,10 +110,13 @@ def register_child(self, model, model_admin): def get_child_models(self): """ Return the derived model classes which this admin should handle. - This should return a list of tuples, exactly like :attr:`child_models` is. - The model classes can be retrieved as ``base_model.__subclasses__()``, - a setting in a config file, or a query of a plugin registration system at your option + This should return a list of tuples, exactly like + :attr:`child_models` is. + + The model classes can be retrieved as + ``base_model.__subclasses__()``, a setting in a config file, or + a query of a plugin registration system at your option """ if self.child_models is not None: return self.child_models From c97c5c68772fc7bab2880f4e353e2783568aee1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s-Combarro=20=27piranna?= Date: Sun, 19 May 2024 22:02:34 +0200 Subject: [PATCH 07/15] Use already initialized `_child_models` --- polymorphic/admin/parentadmin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polymorphic/admin/parentadmin.py b/polymorphic/admin/parentadmin.py index cc8a193b..355de6b9 100644 --- a/polymorphic/admin/parentadmin.py +++ b/polymorphic/admin/parentadmin.py @@ -138,7 +138,7 @@ def get_child_type_choices(self, request, action): """ self._lazy_setup() - child_models = self.get_child_models() + child_models = self._child_models if not child_models: raise ImproperlyConfigured("No child models are available.") From 7a0f54ca40ad6a596a0761f12ff59e9c5e61db7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s-Combarro=20=27piranna?= Date: Sun, 19 May 2024 22:03:25 +0200 Subject: [PATCH 08/15] Allow to exclude child subclasses --- polymorphic/admin/helpers.py | 10 +++++----- polymorphic/admin/inlines.py | 5 ++++- polymorphic/admin/parentadmin.py | 5 ++++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/polymorphic/admin/helpers.py b/polymorphic/admin/helpers.py index d819f641..8961be70 100644 --- a/polymorphic/admin/helpers.py +++ b/polymorphic/admin/helpers.py @@ -144,17 +144,17 @@ def get_inline_formsets(self, request, formsets, inline_instances, obj=None, *ar return inline_admin_formsets -def get_leaf_subclasses(cls): +def get_leaf_subclasses(cls, exclude=None): "Get leaf subclasses of `cls` class" result = [] subclasses = cls.__subclasses__() - if not subclasses: - result.append(cls) - else: + if subclasses: for subclass in subclasses: - result.extend(get_leaf_subclasses(subclass)) + result.extend(get_leaf_subclasses(subclass, exclude)) + elif not (exclude and cls in exclude): + result.append(cls) return result diff --git a/polymorphic/admin/inlines.py b/polymorphic/admin/inlines.py index 455aea8d..6f76011c 100644 --- a/polymorphic/admin/inlines.py +++ b/polymorphic/admin/inlines.py @@ -54,6 +54,7 @@ class PolymorphicInlineModelAdmin(InlineModelAdmin): #: Inlines for all model sub types that can be displayed in this inline. #: Each row is a :class:`PolymorphicInlineModelAdmin.Child` child_inlines = None + exclude_childs = None def __init__(self, parent_model, admin_site): super().__init__(parent_model, admin_site) @@ -91,7 +92,9 @@ def get_child_inlines(self): if self.child_inlines is not None: return self.child_inlines - child_inlines = get_leaf_subclasses(PolymorphicInlineModelAdmin.Child) + child_inlines = get_leaf_subclasses( + PolymorphicInlineModelAdmin.Child, self.exclude_childs + ) child_inlines = tuple( inline for inline in child_inlines diff --git a/polymorphic/admin/parentadmin.py b/polymorphic/admin/parentadmin.py index 355de6b9..9dd96a66 100644 --- a/polymorphic/admin/parentadmin.py +++ b/polymorphic/admin/parentadmin.py @@ -51,6 +51,7 @@ class PolymorphicParentModelAdmin(admin.ModelAdmin): #: The child models that should be displayed child_models = None + exclude_childs = None #: Whether the list should be polymorphic too, leave to ``False`` to optimize polymorphic_list = False @@ -121,7 +122,9 @@ def get_child_models(self): if self.child_models is not None: return self.child_models - child_models = get_leaf_subclasses(self.base_model) + child_models = get_leaf_subclasses( + self.base_model, self.exclude_childs + ) if child_models: return child_models From aaa7fa316d8b196ea2ff57a65eadc2868aaf56ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s-Combarro=20=27piranna?= Date: Mon, 17 Jun 2024 13:13:26 +0200 Subject: [PATCH 09/15] Don't consider `abstract` Models as leaf subclasses --- polymorphic/admin/helpers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/polymorphic/admin/helpers.py b/polymorphic/admin/helpers.py index 8961be70..aa991613 100644 --- a/polymorphic/admin/helpers.py +++ b/polymorphic/admin/helpers.py @@ -154,7 +154,10 @@ def get_leaf_subclasses(cls, exclude=None): if subclasses: for subclass in subclasses: result.extend(get_leaf_subclasses(subclass, exclude)) - elif not (exclude and cls in exclude): + elif not ( + (hasattr(cls, '_meta') and cls._meta.abstract) or + (exclude and cls in exclude) + ): result.append(cls) return result From 0f5f3026a752f793261e8e3975fd0f40342f330b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s-Combarro=20=27piranna?= Date: Mon, 2 Sep 2024 07:48:58 +0200 Subject: [PATCH 10/15] Replace `childs` for `children` --- polymorphic/admin/inlines.py | 4 ++-- polymorphic/admin/parentadmin.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/polymorphic/admin/inlines.py b/polymorphic/admin/inlines.py index 6f76011c..c3f9298b 100644 --- a/polymorphic/admin/inlines.py +++ b/polymorphic/admin/inlines.py @@ -54,7 +54,7 @@ class PolymorphicInlineModelAdmin(InlineModelAdmin): #: Inlines for all model sub types that can be displayed in this inline. #: Each row is a :class:`PolymorphicInlineModelAdmin.Child` child_inlines = None - exclude_childs = None + exclude_children = None def __init__(self, parent_model, admin_site): super().__init__(parent_model, admin_site) @@ -93,7 +93,7 @@ def get_child_inlines(self): return self.child_inlines child_inlines = get_leaf_subclasses( - PolymorphicInlineModelAdmin.Child, self.exclude_childs + PolymorphicInlineModelAdmin.Child, self.exclude_children ) child_inlines = tuple( inline diff --git a/polymorphic/admin/parentadmin.py b/polymorphic/admin/parentadmin.py index 9dd96a66..8ac0d57c 100644 --- a/polymorphic/admin/parentadmin.py +++ b/polymorphic/admin/parentadmin.py @@ -51,7 +51,7 @@ class PolymorphicParentModelAdmin(admin.ModelAdmin): #: The child models that should be displayed child_models = None - exclude_childs = None + exclude_children = None #: Whether the list should be polymorphic too, leave to ``False`` to optimize polymorphic_list = False @@ -123,7 +123,7 @@ def get_child_models(self): return self.child_models child_models = get_leaf_subclasses( - self.base_model, self.exclude_childs + self.base_model, self.exclude_children ) if child_models: From b6cac5eeaa6c32b47deed85d6b553fef2726c335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s-Combarro=20=27piranna?= Date: Mon, 2 Sep 2024 07:56:27 +0200 Subject: [PATCH 11/15] Accept single instance in `exclude` --- polymorphic/admin/helpers.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/polymorphic/admin/helpers.py b/polymorphic/admin/helpers.py index aa991613..5577983b 100644 --- a/polymorphic/admin/helpers.py +++ b/polymorphic/admin/helpers.py @@ -147,6 +147,13 @@ def get_inline_formsets(self, request, formsets, inline_instances, obj=None, *ar def get_leaf_subclasses(cls, exclude=None): "Get leaf subclasses of `cls` class" + if exclude is None: + exclude = () + + elif not isinstance(exclude, (list, tuple)): + # Accept single instance in `exclude` + exclude = (exclude,) + result = [] subclasses = cls.__subclasses__() @@ -155,8 +162,7 @@ def get_leaf_subclasses(cls, exclude=None): for subclass in subclasses: result.extend(get_leaf_subclasses(subclass, exclude)) elif not ( - (hasattr(cls, '_meta') and cls._meta.abstract) or - (exclude and cls in exclude) + cls in exclude or (hasattr(cls, '_meta') and cls._meta.abstract) ): result.append(cls) From 49be2ef12fe618e01ef2f445954e7bc671bd4029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s-Combarro=20=27piranna?= Date: Mon, 2 Sep 2024 08:12:55 +0200 Subject: [PATCH 12/15] Added documentation --- polymorphic/admin/inlines.py | 6 ++++++ polymorphic/admin/parentadmin.py | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/polymorphic/admin/inlines.py b/polymorphic/admin/inlines.py index c3f9298b..c46797d4 100644 --- a/polymorphic/admin/inlines.py +++ b/polymorphic/admin/inlines.py @@ -54,6 +54,12 @@ class PolymorphicInlineModelAdmin(InlineModelAdmin): #: Inlines for all model sub types that can be displayed in this inline. #: Each row is a :class:`PolymorphicInlineModelAdmin.Child` child_inlines = None + + #: The models that should be excluded from the auto-discovered leaf + #: model sub types that can be displayed in this inline. This can be + #: a list of models or a single model. It's useful to exclude + #: non-abstract base models (abstract models are always excluded) + #: when they don't have defined any child models. exclude_children = None def __init__(self, parent_model, admin_site): diff --git a/polymorphic/admin/parentadmin.py b/polymorphic/admin/parentadmin.py index 8ac0d57c..0929efa7 100644 --- a/polymorphic/admin/parentadmin.py +++ b/polymorphic/admin/parentadmin.py @@ -51,6 +51,12 @@ class PolymorphicParentModelAdmin(admin.ModelAdmin): #: The child models that should be displayed child_models = None + + #: The models that should be excluded from the auto-discovered child + #: leaf models that should be displayed. This can be a list of + #: models or a single model. It's useful to exclude non-abstract + #: base models (abstract models are always excluded) when they don't + #: have defined any child models. exclude_children = None #: Whether the list should be polymorphic too, leave to ``False`` to optimize From 39f1d79043248e42872ea615798b58669afed8e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s-Combarro=20=27piranna?= Date: Mon, 2 Sep 2024 08:25:36 +0200 Subject: [PATCH 13/15] Fix ruff formatting --- polymorphic/admin/helpers.py | 4 +--- polymorphic/admin/inlines.py | 5 +---- polymorphic/admin/parentadmin.py | 4 +--- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/polymorphic/admin/helpers.py b/polymorphic/admin/helpers.py index 5577983b..076e1818 100644 --- a/polymorphic/admin/helpers.py +++ b/polymorphic/admin/helpers.py @@ -161,9 +161,7 @@ def get_leaf_subclasses(cls, exclude=None): if subclasses: for subclass in subclasses: result.extend(get_leaf_subclasses(subclass, exclude)) - elif not ( - cls in exclude or (hasattr(cls, '_meta') and cls._meta.abstract) - ): + elif not (cls in exclude or (hasattr(cls, "_meta") and cls._meta.abstract)): result.append(cls) return result diff --git a/polymorphic/admin/inlines.py b/polymorphic/admin/inlines.py index c46797d4..42d6bc91 100644 --- a/polymorphic/admin/inlines.py +++ b/polymorphic/admin/inlines.py @@ -104,10 +104,7 @@ def get_child_inlines(self): child_inlines = tuple( inline for inline in child_inlines - if ( - inline.model is not None and - issubclass(inline.model, self.model) - ) + if (inline.model is not None and issubclass(inline.model, self.model)) ) if child_inlines: diff --git a/polymorphic/admin/parentadmin.py b/polymorphic/admin/parentadmin.py index 0929efa7..45238651 100644 --- a/polymorphic/admin/parentadmin.py +++ b/polymorphic/admin/parentadmin.py @@ -128,9 +128,7 @@ def get_child_models(self): if self.child_models is not None: return self.child_models - child_models = get_leaf_subclasses( - self.base_model, self.exclude_children - ) + child_models = get_leaf_subclasses(self.base_model, self.exclude_children) if child_models: return child_models From 515885d2fb44fbdd893077b903987b720b440bfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s-Combarro=20=27piranna?= Date: Mon, 2 Sep 2024 08:28:33 +0200 Subject: [PATCH 14/15] Remove deprecated warning on `ruff` linting command --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4706713b..a28a1ee5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,6 +8,7 @@ requires = [ [tool.ruff] line-length = 99 +[tool.ruff.lint] extend-ignore = [ "E501", ] @@ -18,7 +19,7 @@ select = [ "W", ] -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "example/**" = [ "F401", "F403", From b56b3cdaffc44f0313b069b54903a76bfc8b9e5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s-Combarro=20=27piranna?= Date: Mon, 2 Sep 2024 08:42:33 +0200 Subject: [PATCH 15/15] =?UTF-8?q?Add=20`Jes=C3=BAs=20Legan=C3=A9s-Combarro?= =?UTF-8?q?`=20to=20`AUTHORS.rst`=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AUTHORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.rst b/AUTHORS.rst index 6cc53931..47dbf348 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -42,6 +42,7 @@ Contributors * Jacob Rief * James Murty * Jedediah Smith (proxy models support) +* Jesús Leganés-Combarro (Auto-discover child models and inlines, #582) * John Furr * Jonas Haag * Jonas Obrist