Update usage.rst

master
Brandon Taylor 2014-08-25 09:28:21 -04:00
parent 88bdb3816f
commit d3b780593e
1 changed files with 3 additions and 1 deletions

View File

@ -21,10 +21,12 @@ To add sorting to a model, your model needs to inherit from ``Sortable`` and hav
It is also possible to order objects relative to another object that is a ForeignKey. It is also possible to order objects relative to another object that is a ForeignKey.
.. note:: A small caveat here is that ``Category`` must also either inherit from ``Sortable`` or include an ``order`` property which is a ``PositiveSmallInteger`` field. This is due to the way Django admin instantiates classes. .. note:: A small caveat here is that ``Category`` must also either inherit from ``Sortable`` or include an ``order`` property which is a ``PositiveSmallInteger`` field. This is due to the way Django admin instantiates classes.
:: ::
from adminsortable.fields import SortableForeignKey
# models.py # models.py
from adminsortable.fields import SortableForeignKey
class Category(Sortable): class Category(Sortable):
class Meta(Sortable.Meta): class Meta(Sortable.Meta):
pass pass