File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -1590,21 +1590,22 @@ class Query(graphene.ObjectType):
15901590
15911591
15921592def test_should_query_django_objecttype_fields_custom_meta ():
1593- class ArticleTypeOptions (DjangoObjectTypeOptions ):
1594- """Article Type Options with extra fields"""
1595-
1596- fields = yank_fields_from_attrs (
1597- {"headline_with_lang" : graphene .String ()}, _as = graphene .Field ,
1598- )
1599-
16001593 class ArticleBaseType (DjangoObjectType ):
16011594 class Meta :
16021595 abstract = True
16031596
16041597 @classmethod
1605- def __init_subclass_with_meta__ (cls , ** options ):
1606- options .setdefault ("_meta" , ArticleTypeOptions (cls ))
1607- super (ArticleBaseType , cls ).__init_subclass_with_meta__ (** options )
1598+ def __init_subclass_with_meta__ (cls , _meta = None , ** options ):
1599+ if _meta is None :
1600+ _meta = DjangoObjectTypeOptions (cls )
1601+
1602+ _meta .fields = yank_fields_from_attrs (
1603+ {"headline_with_lang" : graphene .String ()}, _as = graphene .Field ,
1604+ )
1605+
1606+ super (ArticleBaseType , cls ).__init_subclass_with_meta__ (
1607+ _meta = _meta , ** options
1608+ )
16081609
16091610 class ArticleCustomType (ArticleBaseType ):
16101611 class Meta :
You can’t perform that action at this time.
0 commit comments