diff --git a/src/django_segments/models/segment.py b/src/django_segments/models/segment.py index 2d20847..c7236c6 100644 --- a/src/django_segments/models/segment.py +++ b/src/django_segments/models/segment.py @@ -27,6 +27,9 @@ class AbstractSegment(models.Model, metaclass=AbstractSegmentMetaclass): and foreign key field instances in the concrete subclass. Examples: + + .. code-block:: python + class MySegment(AbstractSegment): segment_span = models.ForeignKey(MySpan, on_delete=models.CASCADE) diff --git a/src/django_segments/models/span.py b/src/django_segments/models/span.py index 14f4c49..2ae68d3 100644 --- a/src/django_segments/models/span.py +++ b/src/django_segments/models/span.py @@ -27,7 +27,10 @@ class AbstractSpan(models.Model, metaclass=AbstractSegmentMetaclass): When the concrete subclass is created, the initial_range_field and current_range_field attributes set to the range field instances. These attributes can be used to access the range field instances in the concrete subclass. - Examples: + Example: + + .. code-block:: python + class MySpan(AbstractSpan): my_range_field = DateTimeRangeField() initial_range_field_name = 'my_range_field'