app/modules/users/services.py
def fetch_all(self, db: Session, only_admin=False) -> List[UserResponse]:
        """
        Retrieve a list of users.

        Args:
            db (Session): The database session.

        Returns:
            List[UserResponse]: A List of users response models.
        """
        users = db.query(User).filter(
            User.is_deleted == False
        )

        if only_admin == True:
            users = users.filter(User.admin == True)

        return users.all()

        Retrieve a list of users.

        Args:
            db (Session): The database session.

        Returns:
            List[UserResponse]: A List of users response models.
        
Retrieve a list of users.
Retrieve a list of users .
def fetch_all(self, db: Session, only_admin=False) -> List[UserResponse]:
        users = db.query(User).filter(
            User.is_deleted == False
        )
        if only_admin == True:
            users = users.filter(User.admin == True)
        return users.all()
def fetch_all ( self , db : Session , only_admin = False ) -> List [ UserResponse ] : users = db . query ( User ) . filter ( User . is_deleted == False ) if only_admin == True : users = users . filter ( User . admin == True ) return users . all ( )
Retrieve a list of users.
Retrieve a list of users .
"""
        Retrieve a list of users.

        Args:
            db (Session): The database session.

        Returns:
            List[UserResponse]: A List of users response models.
        """
A List of users response models.
A List of users response models .
List[UserResponse]
self
db
Session
The database session.
The database session .
only_admin