mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-07-14 02:02:20 +03:00
fix
This commit is contained in:
parent
890ef28b85
commit
c233330115
|
@ -87,7 +87,7 @@ def convert_choice_name(name):
|
||||||
|
|
||||||
def get_choices(choices):
|
def get_choices(choices):
|
||||||
converted_names = []
|
converted_names = []
|
||||||
for value, help_text in choices:
|
for value, help_text in choices.items():
|
||||||
if isinstance(help_text, (tuple, list)):
|
if isinstance(help_text, (tuple, list)):
|
||||||
for choice in get_choices(help_text):
|
for choice in get_choices(help_text):
|
||||||
yield choice
|
yield choice
|
||||||
|
@ -105,7 +105,7 @@ def convert_django_field_with_choices(field, registry=None):
|
||||||
converted = registry.get_converted_field(field)
|
converted = registry.get_converted_field(field)
|
||||||
if converted:
|
if converted:
|
||||||
return converted
|
return converted
|
||||||
choices = getattr(field, "choices", None)
|
choices = dict(getattr(field, "choices", None))
|
||||||
if choices:
|
if choices:
|
||||||
field_class = field.owner
|
field_class = field.owner
|
||||||
name = to_camel_case("{}_{}".format(field_class.__name__, field.name))
|
name = to_camel_case("{}_{}".format(field_class.__name__, field.name))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user