Django comes with a complete collection of model fields that you can use to build your models. However, you can also create your own model fields to store custom data or alter the behavior of existing fields.
We need a field that allows us to specify an order for objects. If you think about an easy way to do this with a field provided by Django, you will probably think of adding a
PositiveIntegerField to your models. This is a good starting point. We can create a custom field that inherits from
PositiveIntegerField and provides additional behavior.
There are two relevant functionalities that we will build into our order field: