Skip to content

Commit 8083ab9

Browse files
committed
readme update
1 parent 41ed7cb commit 8083ab9

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

README.rst

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,31 @@
3030
.. _enumerations: https://docs.python.org/3/library/enum.html#enum.Enum
3131
.. _ValueError: https://docs.python.org/3/library/exceptions.html#ValueError
3232
.. _DRY: https://en.wikipedia.org/wiki/Don%27t_repeat_yourself
33+
.. _enum-properties: <https://pypi.org/project/enum-properties/>
34+
.. _django-enum: <https://django-enum.readthedocs.io/en/latest/>:
3335

3436
Django Enum
3537
###########
3638

3739
Full and natural support for enumerations_ as Django model fields.
3840

39-
`django-enum <https://django-enum.readthedocs.io/en/latest/>`_ works in concert
40-
with Django_'s built in ``TextChoices`` and ``IntegerChoices`` to provide a new
41-
model field type, ``EnumField``, that resolves the correct native Django_ field
42-
type for the given enumeration based on its value type and range. For example,
43-
``IntegerChoices`` that contain values between 0 and 32767 become
44-
`PositiveSmallIntegerField <https://docs.djangoproject.com/en/stable/ref/models/fields/#positivesmallintegerfield>`_.
41+
Many packages aim to ease usage of Python enumerations as model fields. Most
42+
were made obsolete when Django provided ``TextChoices`` and ``IntegerChoices``
43+
types. The motivation for django-enum_ was to:
44+
45+
* Always automatically coerce fields to instances of the Enum type.
46+
* Allow strict adherence to Enum values to be disabled.
47+
* Handle migrations appropriately. (See `migrations <https://django-enum.readthedocs.io/en/latest/usage.html#migrations>`_)
48+
* Integrate as fully as possible with Django_'s existing level of enum support.
49+
* Integrate with enum-properties_ to enable richer enumeration types.
50+
* Represent enum fields with the smallest possible column type.
51+
* Be as simple and light-weight an extension to core Django as possible.
52+
53+
django-enum_ works in concert with Django_'s built in ``TextChoices`` and
54+
``IntegerChoices`` to provide a new model field type, ``EnumField``, that
55+
resolves the correct native Django_ field type for the given enumeration based
56+
on its value type and range. For example, ``IntegerChoices`` that contain
57+
values between 0 and 32767 become `PositiveSmallIntegerField <https://docs.djangoproject.com/en/stable/ref/models/fields/#positivesmallintegerfield>`_.
4558

4659
.. code:: python
4760

0 commit comments

Comments
 (0)