InputObjectType.__init_sublcass_with_meta__ skips Meta.fields attribute
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 55/100
調査の方向性
InputObjectType.init_subclass_with_meta から始め、文書化されている Meta.fields オプションとの処理を比較してください。参照されている動作について graphene/tests/issues/test_720.py を確認してください。Meta.fields が保持され、InputObjectType のサブクラス化によってそれらのフィールドが破棄されないことを示すテストでカバーされれば完了です。
索引モデルが issue の本文から書いたものです。
説明
In InputObjectType.__init_subclass_with_meta__, the fields of the Meta class (passed as an options arg) are never referenced. This in effect just skips them completely wich stands in contradiction to the docstring.
Meta class options (optional):
...
fields (Dict[str, graphene.InputField]): Dictionary of field name to InputField. Not
recommended to use (prefer class attributes).
InputObjectType has to be subclassed and __init_subclass_with_meta__ has to be extended for this feature to work, like in graphene.tests.issues.test_720.
If this is accepted I can do a PR for this along the lines:
@classmethod
+ def __init_subclass_with_meta__(cls, container=None, _meta=None, fields=None **options):
- def __init_subclass_with_meta__(cls, container=None, _meta=None, **options):
if not _meta:
_meta = InputObjectTypeOptions(cls)
+ if not fields:
+ fields = {}
- fields = {}
for base in reversed(cls.__mro__):
fields.update(yank_fields_from_attrs(base.__dict__, _as=InputField))
if _meta.fields:
_meta.fields.update(fields)
else:
_meta.fields = fields
if container is None:
container = type(cls.__name__, (InputObjectTypeContainer, cls), {})
_meta.container = container
super(InputObjectType, cls).__init_subclass_with_meta__(_meta=_meta, **options)
- 主要言語
- Python
- スター
- 8.2k
- フォーク
- 818
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
graphql-python/graphene のほかの issue
-
Tutorial mistakes オープン🐛 bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
graphql-python/graphene#1389 · コメント 5 件 · リアクション 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
graphql-python/graphene#1606 ·
-
Python 3.14 support オープン✨ enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 38/100
graphql-python/graphene#1601 · コメント 2 件 ·
-
✨ enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
graphql-python/graphene#1600 ·
-
🐛 bug
難易度 2/5 1〜3時間 初心者へのやさしさ 55/100
graphql-python/graphene#1593 ·
graphql-python/graphene の issue をすべて見る
似ている issue
-
agent-ready documentation needs-triage
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" オープン
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
instance instance add
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
searxng/searx-instances#939 · コメント 1 件 ·
-
area-deployment area-integrations triage:bot-seen
難易度 2/5 半日 初心者へのやさしさ 86/100