def get_user_dto(self, user_id: int):
     user_dto = self.interface.get_user_dtos([user_id])[0]
     converted_user_dto = UserDto(user_id=user_dto.user_id,
                                  username=user_dto.username,
                                  profile_pic=user_dto.profile_pic,
                                  phone_no=user_dto.phone_no,
                                  is_admin=user_dto.is_admin)
     return converted_user_dto
def user_admin_dto():
    user_admin_dto = UserDto(
        user_id=1,
        username="******",
        is_admin=True,
        profile_pic="http://www.google.com",
        phone_no="9999999999"
        )

    return user_admin_dto
    def get_user_dtos(self, user_ids: List[int]):

        user_dtos = self.interface.get_user_dtos(user_ids)
        converted_user_dtos = [
            UserDto(user_id=user_dto.user_id,
                    username=user_dto.username,
                    profile_pic=user_dto.profile_pic,
                    phone_no=user_dto.phone_no,
                    is_admin=user_dto.is_admin) for user_dto in user_dtos
        ]

        return converted_user_dtos
Beispiel #4
0
    ProjectDto, UserDto,\
    ProjectDetailsDto, TaskDetailsDto,\
    StateDto, StateDetailsDto, WorkflowDetailsDto,\
    TransitionDetailsDto

project_data = {
    "name": "projectManagement",
    "description": "it's a blaw blaw blaw blaw  blaw blaw ",
    "workflow_id": 1,
    "project_type": "Classic Software",
    "developers": [1]
}

user_dto = UserDto(user_id=1,
                   username="******",
                   profile_pic="http://www.google.com",
                   phone_no="8739835635",
                   is_admin=True)

project_dto = ProjectDto(name=project_data.get('name'),
                         description=project_data.get('description'),
                         workflow_id=project_data.get('workflow_id'),
                         project_type=project_data.get('project_type'),
                         developers=project_data.get('developers'))

projects_dtos = [
    ProjectDto(name=project_data.get('name'),
               description=project_data.get('description'),
               workflow_id=project_data.get('workflow_id'),
               project_type=project_data.get('project_type'),
               developers=project_data.get('developers'))