mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-04-25 19:36:02 +03:00
Set model dependency in conversion
This commit is contained in:
parent
41222c1565
commit
4996a72725
|
@ -101,7 +101,8 @@ def convert_form_field_with_choices(field, name=None, form=None):
|
|||
"""
|
||||
choices = getattr(field, 'choices', None)
|
||||
|
||||
if choices:
|
||||
# If is a choice field, but not depends on models
|
||||
if choices and not isinstance(form, (forms.ModelMultipleChoiceField, forms.ModelChoiceField)):
|
||||
if form:
|
||||
name = to_camel_case("{}_{}".format(get_form_name(form), field.label or name))
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue
Block a user