mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-07-04 20:33:12 +03:00
Merge branch 'main' into patch-1
This commit is contained in:
commit
cbe59b29db
|
@ -1,5 +1,5 @@
|
||||||
graphene>=2.1,<3
|
graphene>=2.1,<3
|
||||||
graphene-django>=2.1,<3
|
graphene-django>=2.1,<3
|
||||||
graphql-core>=2.1,<3
|
graphql-core>=2.1,<3
|
||||||
django==3.1.14
|
django==3.2.24
|
||||||
django-filter>=2
|
django-filter>=2
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import inspect
|
import inspect
|
||||||
from collections import OrderedDict
|
|
||||||
from collections.abc import Callable
|
from collections.abc import Callable
|
||||||
from functools import partial, singledispatch, wraps
|
from functools import partial, singledispatch, wraps
|
||||||
|
|
||||||
|
@ -75,8 +74,13 @@ def get_choices(choices):
|
||||||
converted_names = []
|
converted_names = []
|
||||||
if isinstance(choices, Callable):
|
if isinstance(choices, Callable):
|
||||||
choices = choices()
|
choices = choices()
|
||||||
if isinstance(choices, OrderedDict):
|
|
||||||
|
# In restframework==3.15.0, choices are not passed
|
||||||
|
# as OrderedDict anymore, so it's safer to check
|
||||||
|
# for a dict
|
||||||
|
if isinstance(choices, dict):
|
||||||
choices = choices.items()
|
choices = choices.items()
|
||||||
|
|
||||||
for value, help_text in choices:
|
for value, help_text in choices:
|
||||||
if isinstance(help_text, (tuple, list)):
|
if isinstance(help_text, (tuple, list)):
|
||||||
yield from get_choices(help_text)
|
yield from get_choices(help_text)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user