zeeguu/core/model/user_exercise_session.py
def find_by_cohort(cls,
                       cohort_id,
                       from_date: str = VERY_FAR_IN_THE_PAST,
                       to_date: str = VERY_FAR_IN_THE_FUTURE,
                       is_active: bool = None):
        """
            Get exercise sessions by cohort
            return: object or None if not found
        """
        query = cls.query.join(User).filter(User.cohort_id == cohort_id)
        query = query.filter(cls.start_time >= from_date)
        query = query.filter(cls.start_time <= to_date)

        if is_active is not None:
            query = query.filter(cls.is_active == is_active)
        query = query.order_by('start_time')

        sessions = query.all()
        return sessions

            Get exercise sessions by cohort
            return: object or None if not found
        
Get exercise sessions by cohort
return: object or None if not found
Get exercise sessions by cohort return : object or None if not found
def find_by_cohort(cls,
                       cohort_id,
                       from_date: str = VERY_FAR_IN_THE_PAST,
                       to_date: str = VERY_FAR_IN_THE_FUTURE,
                       is_active: bool = None):
        query = cls.query.join(User).filter(User.cohort_id == cohort_id)
        query = query.filter(cls.start_time >= from_date)
        query = query.filter(cls.start_time <= to_date)
        if is_active is not None:
            query = query.filter(cls.is_active == is_active)
        query = query.order_by('start_time')
        sessions = query.all()
        return sessions
def find_by_cohort ( cls , cohort_id , from_date : str = VERY_FAR_IN_THE_PAST , to_date : str = VERY_FAR_IN_THE_FUTURE , is_active : bool = None ) : query = cls . query . join ( User ) . filter ( User . cohort_id == cohort_id ) query = query . filter ( cls . start_time >= from_date ) query = query . filter ( cls . start_time <= to_date ) if is_active is not None : query = query . filter ( cls . is_active == is_active ) query = query . order_by ( 'start_time' ) sessions = query . all ( ) return sessions
Get exercise sessions by cohort
return: object or None if not found
Get exercise sessions by cohort return : object or None if not found
"""
            Get exercise sessions by cohort
            return: object or None if not found
        """
cls
cohort_id
from_date
str
to_date
str
is_active
bool