Skip to content

Commit

Permalink
chore(readme) Improves README.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
maikyguanaes authored and fgmacedo committed Sep 2, 2019
1 parent 9ff66f1 commit 6342b6e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -383,3 +383,30 @@ Usage with Graphene_ Enums:
.. code:: python
UserStatusEnum = graphene.Enum.from_enum(UserStatus)
----------
Schematics
----------

Usage with Schematics_ Enums:

.. _Schematics: https://schematics.readthedocs.io/en/latest/usage/types.html

.. code:: python
from schematics.models import Model as SchematicModel
from schematics.types import StringType, DateTimeType
from choicesenum import ChoicesEnum
from choicesenum.schematics.types import ChoicesEnumType
class HttpStatus(ChoicesEnum):
OK = 200
BAD_REQUEST = 400
UNAUTHORIZED = 401
FORBIDDEN = 403
class CustomSchematicModel(SchematicModel):
name = StringType(required=True, max_length=255)
created = DateTimeType(required=True, formats=('%d/%m/%Y', ''))
http = ChoicesEnumType(HttpStatuses, required=True)

0 comments on commit 6342b6e

Please sign in to comment.