Tweak enum examples

This commit is contained in:
Jonathan Kim 2020-06-25 10:59:22 +01:00
parent 3327ca47c2
commit 0dca8ef1c8

View File

@ -61,7 +61,8 @@ you can add description etc. to your enum without changing the original:
graphene.Enum.from_enum(
AlreadyExistingPyEnum,
description=lambda v: return 'foo' if v == AlreadyExistingPyEnum.Foo else 'bar')
description=lambda v: return 'foo' if v == AlreadyExistingPyEnum.Foo else 'bar'
)
Notes
@ -76,6 +77,7 @@ In the Python ``Enum`` implementation you can access a member by initing the Enu
.. code:: python
from enum import Enum
class Color(Enum):
RED = 1
GREEN = 2
@ -89,6 +91,7 @@ However, in Graphene ``Enum`` you need to call get to have the same effect:
.. code:: python
from graphene import Enum
class Color(Enum):
RED = 1
GREEN = 2