database.crud
Module for database CRUD operations
Module Contents
Functions
|
Get user by user name |
|
Get number of users |
|
Get all projects |
|
Get project by name |
|
Get document of project |
|
Get system permission of user if exists, None otherwise |
|
Get project permission of user if exists, None otherwise |
|
Get project permissions of user |
|
Get document permission of user if exists, None otherwise |
|
Get document permissions of user |
|
Get MS Project of project if exists, None otherwise |
- database.crud.get_user(session, user_name)
Get user by user name
- Parameters
session (sqlmodel.Session) – session to use
user_name (str) – user name
- Returns
user if found, None otherwise
- Return type
- database.crud.get_users_count(session)
Get number of users
- Parameters
session (sqlmodel.Session) – session to use
- Returns
number of users
- database.crud.get_projects(session)
Get all projects
- Parameters
session (sqlmodel.Session) – session to use
- Returns
list of projects
- database.crud.get_project_by_name(session, project_name)
Get project by name
- Parameters
session (sqlmodel.Session) – session to use
project_name (str) – project name
- Returns
project if found, None otherwise
- database.crud.get_document_of_project(session, project_name, document_name)
Get document of project
- Parameters
session (sqlmodel.Session) – session to use
project_name (str) – project name
document_name (str) – document name
- Returns
document if found, None otherwise
- database.crud.get_system_permission(session, user_name, permission)
Get system permission of user if exists, None otherwise
- Parameters
session (sqlmodel.Session) – session to use
user_name (str) – user name
permission (datatypes.models.SysPermissions) – permission to find
- Returns
permission if found, None otherwise
- database.crud.get_project_permission(session, user_name, project_name, permission)
Get project permission of user if exists, None otherwise
- Parameters
session (sqlmodel.Session) – session to use
user_name (str) – user name
project_name (str) – project name
permission (datatypes.models.ProjPermissions) – permission to find
- Returns
permission if found, None otherwise
- database.crud.get_project_permissions(session, user_name, project_name)
Get project permissions of user
- Parameters
session (sqlmodel.Session) – session to use
user_name (str) – user name
project_name (str) – project name
- Returns
list of permissions
- database.crud.get_document_permission(session, user_name, project_name, document_name, permission)
Get document permission of user if exists, None otherwise
- Parameters
session (sqlmodel.Session) – session to use
user_name (str) – user name
project_name (str) – project name
document_name (str) – document name
permission (datatypes.models.DocPermissions) – permission to find
- Returns
permission if found, None otherwise
- database.crud.get_document_permissions(session, user_name, project_name, document_name)
Get document permissions of user
- Parameters
session (sqlmodel.Session) – session to use
user_name (str) – user name
project_name (str) – project name
document_name (str) – document name
- Returns
list of permissions
- database.crud.get_ms_project(session, project_name, ms_project_name)
Get MS Project of project if exists, None otherwise
- Parameters
session (sqlmodel.Session) – session to use
project_name (str) – project name
ms_project_name (str) – MS Project name
- Returns
MS Project if found, None otherwise