From 08676a3e3a6b32530100b2bd57dfcf582d8597e3 Mon Sep 17 00:00:00 2001 From: jacklinke Date: Thu, 30 May 2024 15:13:02 -0400 Subject: [PATCH] Update to show recent changes and signals --- docs/reference.md | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/docs/reference.md b/docs/reference.md index 57818a7..f5b2f69 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -54,20 +54,21 @@ These options are used to configure the behavior of all Span models, and can be class Config: """Custom configuration options for this span.""" - allow_gaps = False + allow_span_gaps = False + allow_segment_gaps = False soft_delete = False -.. data:: ALLOW_GAPS +.. data:: ALLOW_SPAN_GAPS - Allow gaps between segments in a span. Default is ``True``. + Allow gaps between the boundaries of the Span and its first and last Segments. Default is ``True``. If ``False``, when a new Span is created, a Segment will be created to fill the range of the Span. -.. data:: STICKY_BOUNDARIES +.. data:: ALLOW_SEGMENT_GAPS - Force spans & segments to have sticky boundaries (if a range boundary for a span or segment is the same as another segment or the encompassing span, any changes to the boundary are proparated to the objects sharing that boundary). Default is ``True``. + Allow gaps between the Segments in a Span. Default is ``True``. If ``False``, all Segments in a Span must be contiguous. .. data:: SOFT_DELETE - Use soft delete for segments and spans. Default is ``True``. + Use soft delete for segments and spans. Default is ``True``. If ``True``, a ``deleted_at`` field will be added to the Span and Segment models. When a soft delete occurs, the ``deleted_at`` field will be set to the current date and time, and queries will exclude deleted Segments and Spans by default. exceptions.py ============= @@ -109,6 +110,19 @@ models/span.py .. automodule:: django_segments.models.span :members: +signals.py +========== + +.. automodule:: django_segments.signals + :members: + +When deleting or soft deleting a span, several signals are sent as the Span and its associated Segments are deleted. In each case, the more specific signal is wrapped in the more general signal. This allows you to connect to the more general signal and still receive the more specific signal. The signals are sent in the following order: + +.. image:: https://raw.githubusercontent.com/OmenApps/django-segments/main/docs/media/signals-delete.png + :alt: Signal Order + :align: center + + views.py ========