You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add options to override how Django Choice fields are converted t… (#860)
* Add new setting to create unique enum names
* Add specific tests for name generation
* Add schema test
* Rename settings field
* Rename setting
* Add custom function setting
* Add documentation
* Use format instead of f strings
* Update graphene_django/converter.py
Co-Authored-By: Syrus Akbary <[email protected]>
* Fix tests
* Update docs
* Import function through import_string function
Co-authored-by: Syrus Akbary <[email protected]>
Copy file name to clipboardExpand all lines: docs/settings.rst
+30
Original file line number
Diff line number
Diff line change
@@ -140,3 +140,33 @@ Default: ``False``
140
140
# 'messages': ['This field is required.'],
141
141
# }
142
142
# ]
143
+
144
+
145
+
``DJANGO_CHOICE_FIELD_ENUM_V3_NAMING``
146
+
--------------------------------------
147
+
148
+
Set to ``True`` to use the new naming format for the auto generated Enum types from Django choice fields. The new format looks like this: ``{app_label}{object_name}{field_name}Choices``
149
+
150
+
Default: ``False``
151
+
152
+
153
+
``DJANGO_CHOICE_FIELD_ENUM_CUSTOM_NAME``
154
+
--------------------------------------
155
+
156
+
Define the path of a function that takes the Django choice field and returns a string to completely customise the naming for the Enum type.
157
+
158
+
If set to a function then the ``DJANGO_CHOICE_FIELD_ENUM_V3_NAMING`` setting is ignored.
0 commit comments