Lists¶
Finding list entries with Affinity's search¶
client.lists.entries(list_id).find(...), iter_find(...) and find_body(...) filter
and sort a list's entries on Affinity's side (V2 search, beta) and return the same
entries as entries(list_id).list(). They work like the
companies methods and need the
"Export data from Lists" permission.
from affinity.criteria import Condition, Sort
from affinity.types import ListId
page = client.lists.entries(ListId(123)).find(
Condition("field-456", "is-within-the-last", (30, "day")),
sort=Sort("field-789", "desc"),
limit=100,
)
Service for managing lists.
Lists are spreadsheet-like collections of people, companies, or opportunities.
Source code in affinity/services/lists.py
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 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 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 | |
all() -> Iterator[AffinityList]
¶
Iterate through all accessible lists.
Source code in affinity/services/lists.py
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 | |
create(data: ListCreate) -> AffinityList
¶
Create a list (V2); the caller becomes its creator and owner.
A public list needs the "Share accessible Lists globally" permission. V2 can't set
owner_id or additional_permissions: with either, the list is created through V1.
Source code in affinity/services/lists.py
455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 | |
create_field_dropdown_option(list_id: ListId, field_id: AnyFieldId, *, option_type: DropdownOptionType, text: str, rank: int | None = None, color: DropdownOptionColorName | None = None, status_category: DropdownStatusCategory | None = None, win_rate: int | None = None) -> DropdownOption
¶
Add an option to a list field.
option_type must match the field: "dropdown" (text only), "ranked-dropdown"
(rank and color required) or "status-dropdown" (rank, color and
status_category required; win_rate 0-100 only for "open"). Needs Affinity API
version {DROPDOWN_OPTION_WRITES_MIN_API_VERSION} (sent for this call).
Source code in affinity/services/lists.py
543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 | |
delete_field_dropdown_option(list_id: ListId, field_id: AnyFieldId, option_id: int) -> bool
¶
Delete an option of a list field. Cannot be undone.
Affinity also clears this field on every list entry currently set to the option; those values cannot be recovered.
Source code in affinity/services/lists.py
615 616 617 618 619 620 621 622 623 624 625 626 627 | |
entries(list_id: ListId) -> ListEntryService
¶
Get a ListEntryService for a specific list.
This is the explicit path for retrieving "full row" data via list entries.
Source code in affinity/services/lists.py
250 251 252 253 254 255 256 | |
get(list_id: ListId) -> AffinityList
¶
Get a single list by ID (V2).
fields is not filled: use :meth:get_fields. For the number of entries use
:meth:get_size.
Source code in affinity/services/lists.py
367 368 369 370 371 372 373 374 375 | |
get_field_dropdown_option(list_id: ListId, field_id: AnyFieldId, option_id: int) -> DropdownOption
¶
One option of a list field.
Source code in affinity/services/lists.py
535 536 537 538 539 540 541 | |
get_field_dropdown_options(list_id: ListId, field_id: AnyFieldId, *, with_status_types: bool = False) -> builtins.list[DropdownOption]
¶
All options of a list field's dropdown, ranked-dropdown or status field (every page).
Older API versions report status options as ranked-dropdown without
status_category. with_status_types=True reads with API version
{DROPDOWN_OPTION_WRITES_MIN_API_VERSION} (as the option writes do) to get the real
status-dropdown type; a client pinned to an older version then raises
ApiVersionTooOldError.
Source code in affinity/services/lists.py
517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 | |
get_fields(list_id: ListId, *, filter: str | None = None, includes: Sequence[str] | None = None) -> builtins.list[FieldMetadata]
¶
Get fields (columns) for a list.
Includes list-specific, global, enriched, and relationship intelligence fields. Cached for performance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filter
|
str | None
|
Filter on the field name: |
None
|
includes
|
Sequence[str] | None
|
Extra properties per field: |
None
|
Source code in affinity/services/lists.py
478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 | |
get_first() -> AffinityList | None
¶
Get the first list, or None if no lists exist.
Source code in affinity/services/lists.py
307 308 309 310 | |
get_saved_view(list_id: ListId, view_id: SavedViewId) -> SavedView
¶
Get a single saved view.
Source code in affinity/services/lists.py
708 709 710 711 | |
get_saved_views(list_id: ListId, *, limit: int | None = None, cursor: str | None = None) -> PaginatedResponse[SavedView]
¶
Get saved views for a list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
list_id
|
ListId
|
List id for the initial request. |
required |
limit
|
int | None
|
Maximum results per page. |
None
|
cursor
|
str | None
|
Cursor to resume pagination (opaque; obtained from prior responses). |
None
|
Source code in affinity/services/lists.py
633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 | |
get_size(list_id: ListId, *, force: bool = False) -> int
¶
Get accurate list size. Uses V1 API, cached for 5 minutes.
Adding or removing a row through this client (entries(list_id).add_* / delete,
opportunities.create) drops the cached size; changes made elsewhere show after the
cache expires, or with force=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
list_id
|
ListId
|
The list ID. |
required |
force
|
bool
|
If True, bypass cache and fetch fresh value from API. |
False
|
Note: The V2 API's listSize field is unreliable (often returns 0 for non-empty lists). This method uses the V1 API which returns accurate values.
Source code in affinity/services/lists.py
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 | |
iter() -> Iterator[AffinityList]
¶
Auto-paginate all lists.
Alias for all() (FR-006 public contract).
Source code in affinity/services/lists.py
359 360 361 362 363 364 365 | |
list(*, limit: int | None = None, cursor: str | None = None, term: str | None = None) -> PaginatedResponse[AffinityList]
¶
Get all lists accessible to you.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit
|
int | None
|
Maximum results per page. |
None
|
cursor
|
str | None
|
Cursor to resume pagination (opaque; obtained from prior responses). |
None
|
term
|
str | None
|
Only lists whose name contains this text (case-insensitive substring, matched by Affinity). Kept across pages by the cursor. |
None
|
Returns:
| Type | Description |
|---|---|
PaginatedResponse[AffinityList]
|
Paginated list of lists (without field metadata) |
Source code in affinity/services/lists.py
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 | |
pages(*, limit: int | None = None, cursor: str | None = None, term: str | None = None) -> Iterator[PaginatedResponse[AffinityList]]
¶
Iterate list pages (not items), yielding PaginatedResponse[AffinityList].
This is useful for ETL scripts that want checkpoint/resume via page.next_cursor.
term keeps only lists whose name contains it (case-insensitive, matched by Affinity).
Source code in affinity/services/lists.py
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 | |
resolve(*, name: str, list_type: ListType | None = None) -> AffinityList | None
¶
Find a single list by name (case-insensitive exact match; optionally filtered by type).
Notes:
- Affinity narrows the lists by name first (term); the exact comparison is made
here. If that finds nothing, every list is checked (see resolve_all()).
- Matches are cached in-memory on this service instance (a miss is not). If you call
this frequently, reuse the client, or persist the resolved ListId in your own
configuration.
If multiple matches exist, returns the first match in server-provided order.
Source code in affinity/services/lists.py
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 | |
resolve_all(*, name: str, list_type: ListType | None = None) -> builtins.list[AffinityList]
¶
Find all lists matching a name (case-insensitive exact match; optionally by type).
Notes:
- For an ASCII name, Affinity first narrows the lists by name (term, a
case-insensitive substring match) and the exact comparison is made here. If that
yields no match, every list is checked, so a difference in how Affinity folds case
or whitespace can't hide a list. Non-ASCII names always check every list.
- Unlike resolve(), this does not cache results.
Source code in affinity/services/lists.py
431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 | |
saved_views_all(list_id: ListId) -> Iterator[SavedView]
¶
Iterate all saved views for a list.
Source code in affinity/services/lists.py
703 704 705 706 | |
saved_views_pages(list_id: ListId, *, limit: int | None = None, cursor: str | None = None) -> Iterator[PaginatedResponse[SavedView]]
¶
Iterate saved view pages, yielding PaginatedResponse[SavedView].
Source code in affinity/services/lists.py
675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 | |
update_field_dropdown_option(list_id: ListId, field_id: AnyFieldId, option_id: int, *, text: str | None = None, rank: int | None = None, color: DropdownOptionColorName | None = None, status_category: DropdownStatusCategory | None = None, win_rate: int | None = None) -> DropdownOption
¶
Change an option of a list field (only what you pass).
A dropdown option can change its text; ranked-dropdown also rank and color;
status-dropdown also status category and win rate. Renaming changes the value shown
on every entry that has this option. Returns the option as read back afterwards.
Source code in affinity/services/lists.py
577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 | |
Async list operations (TR-009).
Source code in affinity/services/lists.py
1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 | |
all() -> AsyncIterator[AffinityList]
¶
Iterate through all accessible lists.
Source code in affinity/services/lists.py
1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 | |
create(data: ListCreate) -> AffinityList
async
¶
Create a list (V2); the caller becomes its creator and owner.
A public list needs the "Share accessible Lists globally" permission. V2 can't set
owner_id or additional_permissions: with either, the list is created through V1.
Source code in affinity/services/lists.py
2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 | |
create_field_dropdown_option(list_id: ListId, field_id: AnyFieldId, *, option_type: DropdownOptionType, text: str, rank: int | None = None, color: DropdownOptionColorName | None = None, status_category: DropdownStatusCategory | None = None, win_rate: int | None = None) -> DropdownOption
async
¶
Add an option to a list field.
option_type must match the field: "dropdown" (text only), "ranked-dropdown"
(rank and color required) or "status-dropdown" (rank, color and
status_category required; win_rate 0-100 only for "open"). Needs Affinity API
version {DROPDOWN_OPTION_WRITES_MIN_API_VERSION} (sent for this call).
Source code in affinity/services/lists.py
2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 | |
delete_field_dropdown_option(list_id: ListId, field_id: AnyFieldId, option_id: int) -> bool
async
¶
Delete an option of a list field. Cannot be undone.
Affinity also clears this field on every list entry currently set to the option; those values cannot be recovered.
Source code in affinity/services/lists.py
2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 | |
entries(list_id: ListId) -> AsyncListEntryService
¶
Get an AsyncListEntryService for a specific list.
This is the explicit path for retrieving "full row" data via list entries.
Source code in affinity/services/lists.py
1711 1712 1713 1714 1715 1716 1717 | |
get(list_id: ListId) -> AffinityList
async
¶
Get a single list by ID (V2).
fields is not filled: use :meth:get_fields. For the number of entries use
:meth:get_size.
Source code in affinity/services/lists.py
1912 1913 1914 1915 1916 1917 1918 1919 1920 | |
get_field_dropdown_option(list_id: ListId, field_id: AnyFieldId, option_id: int) -> DropdownOption
async
¶
One option of a list field.
Source code in affinity/services/lists.py
2083 2084 2085 2086 2087 2088 2089 | |
get_field_dropdown_options(list_id: ListId, field_id: AnyFieldId, *, with_status_types: bool = False) -> builtins.list[DropdownOption]
async
¶
All options of a list field's dropdown, ranked-dropdown or status field (every page).
Older API versions report status options as ranked-dropdown without
status_category. with_status_types=True reads with API version
{DROPDOWN_OPTION_WRITES_MIN_API_VERSION} (as the option writes do) to get the real
status-dropdown type; a client pinned to an older version then raises
ApiVersionTooOldError.
Source code in affinity/services/lists.py
2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 | |
get_fields(list_id: ListId, *, filter: str | None = None, includes: Sequence[str] | None = None) -> builtins.list[FieldMetadata]
async
¶
Get fields (columns) for a list.
Includes list-specific, global, enriched, and relationship intelligence fields. Cached for performance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filter
|
str | None
|
Filter on the field name: |
None
|
includes
|
Sequence[str] | None
|
Extra properties per field: |
None
|
Source code in affinity/services/lists.py
2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 | |
get_first() -> AffinityList | None
async
¶
Get the first list, or None if no lists exist.
Source code in affinity/services/lists.py
1763 1764 1765 1766 | |
get_saved_view(list_id: ListId, view_id: SavedViewId) -> SavedView
async
¶
Get a single saved view.
Source code in affinity/services/lists.py
1907 1908 1909 1910 | |
get_saved_views(list_id: ListId, *, limit: int | None = None, cursor: str | None = None) -> PaginatedResponse[SavedView]
async
¶
Get saved views for a list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
list_id
|
ListId
|
List id for the initial request. |
required |
limit
|
int | None
|
Maximum results per page. |
None
|
cursor
|
str | None
|
Cursor to resume pagination (opaque; obtained from prior responses). |
None
|
Source code in affinity/services/lists.py
1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 | |
get_size(list_id: ListId, *, force: bool = False) -> int
async
¶
Get accurate list size. Uses V1 API, cached for 5 minutes.
Adding or removing a row through this client (entries(list_id).add_* / delete,
opportunities.create) drops the cached size; changes made elsewhere show after the
cache expires, or with force=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
list_id
|
ListId
|
The list ID. |
required |
force
|
bool
|
If True, bypass cache and fetch fresh value from API. |
False
|
Note: The V2 API's listSize field is unreliable (often returns 0 for non-empty lists). This method uses the V1 API which returns accurate values.
Source code in affinity/services/lists.py
1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 | |
iter() -> AsyncIterator[AffinityList]
¶
Auto-paginate all lists.
Alias for all() (FR-006 public contract).
Source code in affinity/services/lists.py
1819 1820 1821 1822 1823 1824 1825 | |
list(*, limit: int | None = None, cursor: str | None = None, term: str | None = None) -> PaginatedResponse[AffinityList]
async
¶
Get all lists accessible to you.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit
|
int | None
|
Maximum results per page. |
None
|
cursor
|
str | None
|
Cursor to resume pagination (opaque; obtained from prior responses). |
None
|
term
|
str | None
|
Only lists whose name contains this text (case-insensitive substring, matched by Affinity). Kept across pages by the cursor. |
None
|
Returns:
| Type | Description |
|---|---|
PaginatedResponse[AffinityList]
|
Paginated list of lists (without field metadata) |
Source code in affinity/services/lists.py
1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 | |
pages(*, limit: int | None = None, cursor: str | None = None, term: str | None = None) -> AsyncIterator[PaginatedResponse[AffinityList]]
async
¶
Iterate list pages (not items), yielding PaginatedResponse[AffinityList].
This is useful for ETL scripts that want checkpoint/resume via page.next_cursor.
term keeps only lists whose name contains it (case-insensitive, matched by Affinity).
Source code in affinity/services/lists.py
1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 | |
resolve(*, name: str, list_type: ListType | None = None) -> AffinityList | None
async
¶
Find a single list by name (case-insensitive exact match; optionally filtered by type).
Notes:
- Affinity narrows the lists by name first (term); the exact comparison is made
here. If that finds nothing, every list is checked (see resolve_all()).
- Matches are cached in-memory on this service instance (a miss is not). If you call
this frequently, reuse the client, or persist the resolved ListId in your own
configuration.
If multiple matches exist, returns the first match in server-provided order.
Source code in affinity/services/lists.py
1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 | |
resolve_all(*, name: str, list_type: ListType | None = None) -> builtins.list[AffinityList]
async
¶
Find all lists matching a name (case-insensitive exact match; optionally by type).
Notes:
- For an ASCII name, Affinity first narrows the lists by name (term, a
case-insensitive substring match) and the exact comparison is made here. If that
yields no match, every list is checked, so a difference in how Affinity folds case
or whitespace can't hide a list. Non-ASCII names always check every list.
- Unlike resolve(), this does not cache results.
Source code in affinity/services/lists.py
1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 | |
saved_views_all(list_id: ListId) -> AsyncIterator[SavedView]
async
¶
Iterate all saved views for a list.
Source code in affinity/services/lists.py
1901 1902 1903 1904 1905 | |
saved_views_pages(list_id: ListId, *, limit: int | None = None, cursor: str | None = None) -> AsyncIterator[PaginatedResponse[SavedView]]
async
¶
Iterate saved view pages, yielding PaginatedResponse[SavedView].
Source code in affinity/services/lists.py
1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 | |
update_field_dropdown_option(list_id: ListId, field_id: AnyFieldId, option_id: int, *, text: str | None = None, rank: int | None = None, color: DropdownOptionColorName | None = None, status_category: DropdownStatusCategory | None = None, win_rate: int | None = None) -> DropdownOption
async
¶
Change an option of a list field (only what you pass).
A dropdown option can change its text; ranked-dropdown also rank and color;
status-dropdown also status category and win rate. Renaming changes the value shown
on every entry that has this option. Returns the option as read back afterwards.
Source code in affinity/services/lists.py
2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 | |