signals.py#

This module provides two signal handlers that works with a reorder items model field. The field will be identified by the UsingReorderItemsSignalsMixin as its subclass.

The pre_save signal makes sure that the value of this field is set to the next higher value when a new item is created. The post_delete signal fixes the values of the remaining items when an item was deleted.

The items to deduce the next higher value or to fix will be filtered by the fields listed in the grouped_by attribute of the field, if it is set. Otherwise all items will be evaluated.

reorder_items_widget.signals.pre_save_reorder_items(sender, instance, **kwargs)#

A pre_save signal handler setting the ReorderItemsField of a new item to the next higher value.

reorder_items_widget.signals.post_delete_reorder_items(sender, instance, **kwargs)#

A post_delete signal handler fixing the ReorderItemsField values of remaining items.