"""This module holds the Managers and Querysets for the sync apps"""

from django.db import models


class SyncableQuerySet(models.QuerySet):
    """Base Queryset to use with the models inherited from ``Syncable``
    """

    def non_deleted(self):
        """
        Filter only non-deleted ``Syncable`` models.

        Returns
        -------
        Queryset of ``Syncable`` models.

        """
        return self.filter(is_deleted=False)


class SyncableManager(models.Manager.from_queryset(SyncableQuerySet)):
    """The Manager for the ``mtp.apps.common.models.Syncable`` model."""
