From af595b1fe7ebe4f0f2395b8fdf90ec53bf4e55e7 Mon Sep 17 00:00:00 2001 From: Eero Ruohola Date: Tue, 21 Jul 2020 23:35:01 +0300 Subject: [PATCH] Don't terminate the super() chain in SubclassWithMeta.__init_subclass__ --- graphene/utils/subclass_with_meta.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/graphene/utils/subclass_with_meta.py b/graphene/utils/subclass_with_meta.py index c4ee11d7..52088d06 100644 --- a/graphene/utils/subclass_with_meta.py +++ b/graphene/utils/subclass_with_meta.py @@ -19,7 +19,12 @@ class SubclassWithMeta(metaclass=SubclassWithMeta_Meta): """This class improves __init_subclass__ to receive automatically the options from meta""" def __init_subclass__(cls, **meta_options): - """This method just terminates the super() chain""" + """Consume all the passed kwargs and cls's possible `Meta`. + + The consumed kwargs and all of the attributes from `Meta` + will be passed for further processing to the next + `__init_subclass_with_meta__` in the method resolution order. + """ _Meta = getattr(cls, "Meta", None) _meta_props = {} if _Meta: @@ -44,6 +49,7 @@ class SubclassWithMeta(metaclass=SubclassWithMeta_Meta): super_class = super(cls, cls) if hasattr(super_class, "__init_subclass_with_meta__"): super_class.__init_subclass_with_meta__(**options) + super().__init_subclass__() @classmethod def __init_subclass_with_meta__(cls, **meta_options):