Projects
albert.collections.projects.ProjectCollection
Bases: BaseCollection
ProjectCollection is a collection class for managing Project entities in the Albert platform.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AlbertSession
|
The Albert session instance. |
required |
Methods:
| Name | Description |
|---|---|
create |
Create a new project. |
get_by_id |
Retrieve a project by its ID. |
update |
Update a project. |
delete |
Delete a project by its ID. |
search |
Search for Project matching the provided criteria. |
document_search |
Search for documents (attachments) linked to a project. |
get_all |
Retrieve fully hydrated Project entities with optional filters. |
Attributes:
| Name | Type | Description |
|---|---|---|
base_path |
|
Source code in src/albert/collections/projects.py
create
Create a new project.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project
|
Project
|
The project to create. |
required |
Returns:
| Type | Description |
|---|---|
Optional[Project]
|
The created project object if successful, None otherwise. |
Source code in src/albert/collections/projects.py
get_by_id
Retrieve a project by its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The ID of the project to retrieve. |
required |
Returns:
| Type | Description |
|---|---|
Project
|
The project object if found |
Source code in src/albert/collections/projects.py
update
Update a project.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project
|
Project
|
The updated project object. |
required |
Returns:
| Type | Description |
|---|---|
Project
|
The updated project object as returned by the server. |
Source code in src/albert/collections/projects.py
delete
delete(*, id: ProjectId) -> None
Delete a project by its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The ID of the project to delete. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/albert/collections/projects.py
search
search(
*,
text: str | None = None,
status: list[str] | None = None,
market_segment: list[str] | None = None,
application: list[str] | None = None,
technology: list[str] | None = None,
created_by: list[str] | None = None,
location: list[str] | None = None,
program: list[str] | None = None,
technical_lead: list[str] | None = None,
from_created_at: str | None = None,
to_created_at: str | None = None,
facet_field: str | None = None,
facet_text: str | None = None,
contains_field: list[str] | None = None,
contains_text: list[str] | None = None,
linked_to: str | None = None,
my_project: bool | None = None,
my_role: list[str] | None = None,
metadata_filters: dict[str, Any] | None = None,
order_by: OrderBy = DESCENDING,
sort_by: str | None = None,
offset: int | None = None,
max_items: int | None = None,
) -> Iterator[ProjectSearchItem]
Search for Project matching the provided criteria.
⚠️ This method returns partial (unhydrated) entities to optimize performance.
To retrieve fully detailed entities, use :meth:get_all instead.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Full-text search query. |
None
|
status
|
list[str]
|
Filter by project statuses. |
None
|
market_segment
|
list[str]
|
Filter by market segment. |
None
|
application
|
list[str]
|
Filter by application. |
None
|
technology
|
list[str]
|
Filter by technology tags. |
None
|
created_by
|
list[str]
|
Filter by user names who created the project. |
None
|
location
|
list[str]
|
Filter by location(s). |
None
|
program
|
list[str]
|
Filter by project program (custom field). |
None
|
technical_lead
|
list[str]
|
Filter by technical lead (custom field). |
None
|
from_created_at
|
str
|
Earliest creation date in 'YYYY-MM-DD' format. |
None
|
to_created_at
|
str
|
Latest creation date in 'YYYY-MM-DD' format. |
None
|
facet_field
|
str
|
Facet field to filter on. |
None
|
facet_text
|
str
|
Facet text to search for. |
None
|
contains_field
|
list[str]
|
Fields to search inside. |
None
|
contains_text
|
list[str]
|
Values to search for within the |
None
|
linked_to
|
str
|
Entity ID the project is linked to. |
None
|
my_project
|
bool
|
If True, return only projects owned by current user. |
None
|
my_role
|
list[str]
|
User roles to filter by. |
None
|
metadata_filters
|
dict[str, Any]
|
Filters for custom field values, sent in the Warning Do not use this for application, technology, program, technical lead, or market segment. Use their corresponding query parameters instead. |
None
|
order_by
|
OrderBy
|
Sort order. Default is DESCENDING. |
DESCENDING
|
sort_by
|
str
|
Field to sort by. |
None
|
offset
|
int
|
Pagination offset. |
None
|
max_items
|
int
|
Maximum number of items to return in total. If None, fetches all available items. |
None
|
Returns:
| Type | Description |
|---|---|
Iterator[ProjectSearchItem]
|
An iterator of matching partial (unhydrated) Project results. |
Source code in src/albert/collections/projects.py
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 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 | |
document_search
document_search(
*,
linked_to: SearchProjectId,
text: str | None = None,
order_by: OrderBy = DESCENDING,
sort_by: str | None = None,
offset: int | None = None,
max_items: int | None = None,
) -> Iterator[DocumentSearchItem]
Search for documents (attachments) linked to a project.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
linked_to
|
SearchProjectId
|
The project ID to filter documents by (e.g. |
required |
text
|
str
|
Full-text search query for document names. |
None
|
order_by
|
OrderBy
|
Sort order. Default is DESCENDING. |
DESCENDING
|
sort_by
|
str
|
Field to sort by (for example |
None
|
offset
|
int
|
Pagination offset. |
None
|
max_items
|
int
|
Maximum number of items to return in total. If None, fetches all. |
None
|
Returns:
| Type | Description |
|---|---|
Iterator[DocumentSearchItem]
|
Matching document search results. |
Source code in src/albert/collections/projects.py
get_all
get_all(
*,
text: str | None = None,
status: list[str] | None = None,
market_segment: list[str] | None = None,
application: list[str] | None = None,
technology: list[str] | None = None,
created_by: list[str] | None = None,
location: list[str] | None = None,
program: list[str] | None = None,
technical_lead: list[str] | None = None,
from_created_at: str | None = None,
to_created_at: str | None = None,
facet_field: str | None = None,
facet_text: str | None = None,
contains_field: list[str] | None = None,
contains_text: list[str] | None = None,
linked_to: str | None = None,
my_project: bool | None = None,
my_role: list[str] | None = None,
order_by: OrderBy = DESCENDING,
sort_by: str | None = None,
offset: int | None = None,
max_items: int | None = None,
) -> Iterator[Project]
Retrieve fully hydrated Project entities with optional filters.
This method returns complete entity data using get_by_id.
Use :meth:search for faster retrieval when you only need lightweight, partial (unhydrated) entities.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Full-text search query. |
None
|
status
|
list[str]
|
Filter by project statuses. |
None
|
market_segment
|
list[str]
|
Filter by market segment. |
None
|
application
|
list[str]
|
Filter by application. |
None
|
technology
|
list[str]
|
Filter by technology tags. |
None
|
created_by
|
list[str]
|
Filter by user names who created the project. |
None
|
location
|
list[str]
|
Filter by location(s). |
None
|
program
|
list[str]
|
Filter by project program (custom field). |
None
|
technical_lead
|
list[str]
|
Filter by technical lead (custom field). |
None
|
from_created_at
|
str
|
Earliest creation date in 'YYYY-MM-DD' format. |
None
|
to_created_at
|
str
|
Latest creation date in 'YYYY-MM-DD' format. |
None
|
facet_field
|
str
|
Facet field to filter on. |
None
|
facet_text
|
str
|
Facet text to search for. |
None
|
contains_field
|
list[str]
|
Fields to search inside. |
None
|
contains_text
|
list[str]
|
Values to search for within the |
None
|
linked_to
|
str
|
Entity ID the project is linked to. |
None
|
my_project
|
bool
|
If True, return only projects owned by current user. |
None
|
my_role
|
list[str]
|
User roles to filter by. |
None
|
order_by
|
OrderBy
|
Sort order. Default is DESCENDING. |
DESCENDING
|
sort_by
|
str
|
Field to sort by. |
None
|
offset
|
int
|
Pagination offset. |
None
|
max_items
|
int
|
Maximum number of items to return in total. If None, fetches all available items. |
None
|
Returns:
| Type | Description |
|---|---|
Iterator[Project]
|
An iterator of fully hydrated Project entities. |
Source code in src/albert/collections/projects.py
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 | |