diff --git a/README.md b/README.md index 9b60738..c65b808 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Inlines may be drag-and-dropped into any order directly from the change form. ## Usage ### Models -To add sortability to a model, you need to inherit `SortableMixin` and at minimum, define: +To add "sortability" to a model, you need to inherit `SortableMixin` and at minimum, define: - The field which should be used for `Meta.ordering`, which must resolve to one of the integer fields defined in Django's ORM: - `PositiveIntegerField` @@ -106,7 +106,6 @@ A common use case is to have child objects that are sortable relative to a paren # ordering field category_order = models.PositiveIntegerField(default=0, editable=False, db_index=True) - order_field_name = 'category_order' class Project(SortableMixin): class Meta: @@ -117,7 +116,6 @@ A common use case is to have child objects that are sortable relative to a paren # ordering field project_order = models.PositiveIntegerField(default=0, editable=False, db_index=True) - order_field_name = 'project_order' def __unicode__(self): return self.title @@ -152,7 +150,6 @@ Sometimes you might have a parent model that is not sortable, but has child mode # ordering field project_order = models.PositiveIntegerField(default=0, editable=False, db_index=True) - order_field_name = 'project_order' def __unicode__(self): return self.title @@ -429,15 +426,13 @@ the extrahead block with: {% endblock extrahead %} -Sorting within Django-CMS is really only feasible for inline models of a -plugin as Django-CMS already includes sorting for plugin instances. For tabular inlines, -just substitute: +Sorting within Django-CMS is really only feasible for inline models of a plugin as Django-CMS already includes sorting for plugin instances. For tabular inlines, just substitute: - + with: - + ### Rationale diff --git a/README.rst b/README.rst index 12b475c..296604f 100644 --- a/README.rst +++ b/README.rst @@ -75,8 +75,8 @@ Usage Models ~~~~~~ -To add sortability to a model, you need to inherit ``SortableMixin`` and -at minimum, define: +To add "sortability" to a model, you need to inherit ``SortableMixin`` +and at minimum, define: - The field which should be used for ``Meta.ordering``, which must resolve to one of the integer fields defined in Django's ORM: @@ -134,7 +134,6 @@ set up your models and admin options: # ordering field category_order = models.PositiveIntegerField(default=0, editable=False, db_index=True) - order_field_name = 'category_order' class Project(SortableMixin): class Meta: @@ -145,7 +144,6 @@ set up your models and admin options: # ordering field project_order = models.PositiveIntegerField(default=0, editable=False, db_index=True) - order_field_name = 'project_order' def __unicode__(self): return self.title @@ -183,7 +181,6 @@ as such: # ordering field project_order = models.PositiveIntegerField(default=0, editable=False, db_index=True) - order_field_name = 'project_order' def __unicode__(self): return self.title @@ -565,13 +562,13 @@ tabular inlines, just substitute: :: - + with: :: - + Rationale ~~~~~~~~~