def is_in_wait(pid, tid, uid): ''' is in wait list :param str pid: project id :param str tid: team id :param str uid: uid ''' return WaitListDB().is_in_wait(pid=pid, tid=tid, uid=uid)
def list_by_team(pid, tid, uid=None): ''' List team waitting user :param str pid: project id :param str tid: team id :param str uid: uid ''' return WaitListDB().list_by(pid=pid, tid=tid, uid=uid)
def find_history_in_team(uid, pid, tid): ''' Find some one history in team :param str uid: user id :param str pid: project id :param str tid: team id ''' for raw in WaitListDB().find({'pid': pid, 'tid': tid, 'uid': uid}): yield raw
def join_to(pid, tid, uid, note): ''' Join to :param str pid: project id :param str tid: team id :param str uid: uid :param str note: note ''' return WaitListDB().join_to(pid=pid, tid=tid, uid=uid, note=note)
def find_history(uid, pid=None): ''' Find some one history :param str pid: project id :param str uid: user id ''' query = {'uid': uid} if pid is not None: query['pid'] = pid return WaitListDB().find(query)
def make_result(wid, pid, uid, result): ''' make result :param str wid: waitlist id :param str pid: project id :param str uid: user id :param str result: result in approval, deny. ''' return WaitListDB().make_result(_id=wid, pid=pid, uid=uid, result=result)
def is_in_wait(pid: str, tid: str, uid: str) -> int: ''' is in wait list Args: pid (str): Project id. tid (str): Team id. uid (str): User id. Returns: Return the numbers. ''' return WaitListDB().is_in_wait(pid=pid, tid=tid, uid=uid)
def list_by_team(pid: str, tid: str, uid: Optional[str] = None) -> \ Union[Optional[dict[str, Any]], Cursor[dict[str, Any]]]: ''' List team waiting user Args: pid (str): Project id. tid (str): Team id. uid (str): User id. Returns: Return the datas. ''' return WaitListDB().list_by(pid=pid, tid=tid, uid=uid)
def join_to(pid: str, tid: str, uid: str, note: str) -> dict[str, Any]: ''' Join to Args: pid (str): Project id. tid (str): Team id. uid (str): User id. note (str): Note. Returns: Return the datas. ''' return WaitListDB().join_to(pid=pid, tid=tid, uid=uid, note=note)
def find_history_in_team( uid: str, pid: str, tid: str) -> Generator[dict[str, Any], None, None]: ''' Find some one history in team Args: uid (str): User id. pid (str): Project id. tid (str): Team id. Yields: Return the datas. ''' for raw in WaitListDB().find({'pid': pid, 'tid': tid, 'uid': uid}): yield raw
def find_history(uid: str, pid: Optional[str] = None) -> Cursor[dict[str, Any]]: ''' Find some one history Args: pid (str): Project id. uid (str): User id. Returns: Return the [pymongo.cursor.Cursor][] object. ''' query = {'uid': uid} if pid is not None: query['pid'] = pid return WaitListDB().find(query)
def make_index() -> None: ''' Make index for the collection with `index()` ''' BudgetDB().index() ExpenseDB().index() FormDB().index() MailLetterDB().index() MattermostLinkDB().index() MattermostUsersDB().index() OAuthDB().index() ProjectDB(pid='').index() SenderReceiverDB().index() TeamDB(pid='', tid='').index() TeamMemberChangedDB().index() TeamMemberTagsDB().index() TeamPlanDB().index() TelegramDB().index() USessionDB().index() UsersDB().index() WaitListDB().index()
def make_result( wid: str, pid: str, uid: str, result: Literal['approval', 'deny']) -> Optional[dict[str, Any]]: ''' make result Args: wid (str): Waitlist id. pid (str): Project id. uid (str): User id. result (str): List in `approval`, `deny`. Returns: Return the data. ''' return WaitListDB().make_result(_id=wid, pid=pid, uid=uid, result=result)
from models.formdb import FormDB from models.mailletterdb import MailLetterDB from models.mattermost_link_db import MattermostLinkDB from models.mattermostdb import MattermostUsersDB from models.oauth_db import OAuthDB from models.projectdb import ProjectDB from models.senderdb import SenderReceiverDB from models.teamdb import TeamDB from models.teamdb import TeamMemberChangedDB from models.teamdb import TeamMemberTagsDB from models.teamdb import TeamPlanDB from models.users_db import UsersDB from models.usessiondb import USessionDB from models.waitlistdb import WaitListDB if __name__ == '__main__': FormDB().index() MailLetterDB().index() MattermostLinkDB().index() MattermostUsersDB().index() OAuthDB().index() ProjectDB(pid=None).index() SenderReceiverDB().index() TeamDB(pid=None, tid=None).index() TeamMemberChangedDB().index() TeamMemberTagsDB().index() TeamPlanDB().index() USessionDB().index() UsersDB().index() WaitListDB().index()