models/teamdb.py¶
models.teamdb ¶
TeamDB
TeamDB ¶
Bases: DBBase
Team Collection
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pid |
str
|
Project id. |
required |
tid |
str
|
Team id. |
required |
Attributes:
Name | Type | Description |
---|---|---|
pid |
str
|
Project id. |
tid |
str
|
Team id. |
Note
For some use cases, the pid
, tid
could be empty strings.
Source code in models/teamdb.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
|
add ¶
Add data
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
TeamBase
|
The data to inserted / updated. |
required |
Returns:
Type | Description |
---|---|
TeamBase
|
Return the inserted / updated data. |
Source code in models/teamdb.py
add_tag_member ¶
Add tag member
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tag_data |
dict
|
The tag data should be:
|
required |
Source code in models/teamdb.py
default ¶
default data
Returns:
Type | Description |
---|---|
dict[str, Any]
|
Return a default struct. |
Struct
pid
: Project id.tid
: Team id.name
: Team name.owners
:list
List ofuid
as team admin.chiefs
:list
List ofuid
as team chiefs.members
:list
List ofuid
as team members.desc
: Description.tag_members
: List of data{'id': '<random code>', 'name': '<tag name>'}
. The tags for team to mark on members.
TODO
Need refactor in pydantic.
Source code in models/teamdb.py
index ¶
To make collection's index
Indexs
chiefs
members
pid
update_setting ¶
update setting
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
dict
|
The data to inserted / updated. |
required |
Returns:
Type | Description |
---|---|
dict[str, Any]
|
Return the inserted / updated data. |
Source code in models/teamdb.py
update_users ¶
update_users(
field: str,
add_uids: Optional[list[str]] = None,
del_uids: Optional[list[str]] = None,
) -> None
Update users
Parameters:
Name | Type | Description | Default |
---|---|---|---|
field |
str
|
The |
required |
add_uids |
list
|
Optional, list of uids for add them into the |
None
|
del_uids |
list
|
Optional, list of uids for delete them from the |
None
|
Source code in models/teamdb.py
TeamMemberChangedDB ¶
Bases: DBBase
TeamMemberChangedDB Collection
Struct
pid
: from project idtid
: team iduid
: user idcase
:add
,del
,waiting
TODO
Need refactor in pydantic.
Source code in models/teamdb.py
index ¶
make_record ¶
make record
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pid |
str
|
Project id. |
required |
tid |
str
|
Team id. |
required |
action |
dict
|
|
required |
Source code in models/teamdb.py
TeamMemberTagsDB ¶
Bases: DBBase
TeamMemberTagsDB Collection
Save the member's tag info.
Struct
pid
: Project id.tid
: Team id.uid
: User id.tags
: List of tag id.
TODO
Need refactor in pydantic.
Source code in models/teamdb.py
index ¶
update_and_add ¶
update team
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pid |
str
|
Project id. |
required |
tid |
str
|
Team id. |
required |
uid |
str
|
User id. |
required |
tags |
list
|
List of tag id. |
required |
Returns:
Type | Description |
---|---|
dict[str, Any]
|
Return the inserted / updated data. |
Source code in models/teamdb.py
TeamPlanDB ¶
Bases: DBBase
TeamPlan Collection
Source code in models/teamdb.py
add ¶
Save data
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pid |
str
|
Project id. |
required |
tid |
str
|
Team id. |
required |
data |
dict
|
List of data to inserted / updated.
|
required |
Returns:
Type | Description |
---|---|
dict[str, Any]
|
Return the inserted / updated data. |