"""This module holds activities managers for ``assessments`` app."""

from mtp.apps.common.managers import CleanDuplicatedManagerMixin
from mtp.apps.sync.managers import SyncableManager


class AssessableQuerySet:
    """
    Base queryset class for assessing models providing basic filters.

    """

    def assessing(self):
        """
        Filter only assessing models.

        Returns
        -------
        Queryset of assessing models.

        """
        return self.filter(is_assessing=True)

    def non_assessing(self):
        """
        Filter only non-assessing models.

        Returns
        -------
        Queryset of non-assessing models.

        """
        return self.exclude(is_assessing=True)


class AssessableActivityPartUserScoreManager(CleanDuplicatedManagerMixin, SyncableManager):
    """Manager for the ``AssessableActivityPartUserScore`` models."""

    use_in_migrations = True
