""" This module holds the managers and querysets for the ``metaplans`` app. """

from django.db import models

from mtp.apps.sync.managers import SyncableQuerySet


class MetaplanManager(models.Manager):
    """The Manager used by the ``Metaplan`` model."""
    pass


class MetaplanQuerySet(SyncableQuerySet, models.QuerySet):
    """ The QuerySet used by the ``Metaplan`` model."""

    def for_training_session(self, session):
        """ Filter only ``Metaplan`` instances that belong to
        the given training session.

        Returns
        -------
        QuerySet of ``mtp.apps.metaplans.models.Metaplan``

        """
        return self.filter(session=session)


class MetaplanPropositionManager(models.Manager):
    """The Manager used by the ``MetaplanProposition`` model."""
    pass


class MetaplanPropositionQuerySet(SyncableQuerySet, models.QuerySet):
    """ The QuerySet used by the ``MetaplanProposition`` model."""
    pass
