Skip to content

Commit fdaa0bf

Browse files
committed
Rename settings field
1 parent 8c20e18 commit fdaa0bf

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

graphene_django/converter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def description(self):
7070

7171

7272
def generate_enum_name(django_model_meta, field):
73-
if graphene_settings.CHOICES_TO_ENUM_UNIQUE_TYPE_NAME is True:
73+
if graphene_settings.CHOICES_TO_ENUM_V3_NAMING is True:
7474
name = "DjangoModel{app_label}{object_name}{field_name}Choices".format(
7575
app_label=to_camel_case(django_model_meta.app_label.title()),
7676
object_name=django_model_meta.object_name,

graphene_django/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
# Max items returned in ConnectionFields / FilterConnectionFields
3737
"RELAY_CONNECTION_MAX_LIMIT": 100,
3838
"CAMELCASE_ERRORS": False,
39-
# Set to True to enable unique naming for choice field Enum's
40-
"CHOICES_TO_ENUM_UNIQUE_TYPE_NAME": False,
39+
# Set to True to enable v3 naming convention for choice field Enum's
40+
"CHOICES_TO_ENUM_V3_NAMING": False,
4141
}
4242

4343
if settings.DEBUG:

graphene_django/tests/test_converter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def test_should_postgres_range_convert_list():
335335

336336
def test_generate_enum_name():
337337
MockDjangoModelMeta = namedtuple("DjangoMeta", ["app_label", "object_name"])
338-
graphene_settings.CHOICES_TO_ENUM_UNIQUE_TYPE_NAME = True
338+
graphene_settings.CHOICES_TO_ENUM_V3_NAMING = True
339339

340340
# Simple case
341341
field = graphene.Field(graphene.String, name="type")
@@ -352,4 +352,4 @@ def test_generate_enum_name():
352352
== "DjangoModelSomeLongAppNameSomeObjectFizzBuzzChoices"
353353
)
354354

355-
graphene_settings.CHOICES_TO_ENUM_UNIQUE_TYPE_NAME = False
355+
graphene_settings.CHOICES_TO_ENUM_V3_NAMING = False

graphene_django/tests/test_types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ class Query(ObjectType):
496496
)
497497

498498
def test_django_objecttype_convert_choices_enum_naming_collisions(self, PetModel):
499-
graphene_settings.CHOICES_TO_ENUM_UNIQUE_TYPE_NAME = True
499+
graphene_settings.CHOICES_TO_ENUM_V3_NAMING = True
500500

501501
class PetModelKind(DjangoObjectType):
502502
class Meta:
@@ -529,7 +529,7 @@ class Query(ObjectType):
529529
}
530530
"""
531531
)
532-
graphene_settings.CHOICES_TO_ENUM_UNIQUE_TYPE_NAME = False
532+
graphene_settings.CHOICES_TO_ENUM_V3_NAMING = False
533533

534534
def test_django_objecttype_choices_override_enum(self, PetModel):
535535
def convert_choice(model, field_name, **kwargs):

0 commit comments

Comments
 (0)