API
Helpers
invalidate(*keys)
Delete one or more exact cache keys.
Source code in backend/backend/api.py
35 36 37 | |
invalidate_pattern(*patterns)
Delete all cache keys matching the given patterns.
Uses django-redis delete_pattern when available. Falls back to
cache.clear() for non-Redis backends (e.g. LocMemCache).
Source code in backend/backend/api.py
40 41 42 43 44 45 46 47 48 49 50 | |
CustomUser
Views
list_users(request)
The function list_users retrieves a list of CustomUser objects.
Endpoint
- Path:
/api/v2/users - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
Returns:
| Type | Description |
|---|---|
List[CustomUserSchema]
|
List of CustomUser objects. |
Source code in backend/backend/api.py
1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 | |
me(request)
The function me retrieves the CustomUser object of the logged in user.
Endpoint
- Path:
/api/v2/me - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
Returns:
| Type | Description |
|---|---|
CustomUserSchema
|
The CustomUser object of the logged in user. |
Source code in backend/backend/api.py
782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 | |
Schemas
LoginUserSchema
Schema to represent a LoginUserSchema.
Attributes:
| Name | Type | Description |
|---|---|---|
email |
str
|
User email. |
profile_picture |
str
|
Path to user picutre. Default=None. |
male |
bool
|
Toggle if male or not. |
user_color |
str
|
Hex value of a user color. |
first_name |
str
|
User first name. |
last_name |
str
|
User last name. |
fullname |
str
|
Full name of user. |
is_superuser |
bool
|
Toggle if user is superuser. |
is_staff |
bool
|
Toggle if user is staff. |
is_active |
bool
|
Toggle if user is active. |
groups |
List[int]
|
List of group ids user belongs to. |
Source code in backend/backend/api.py
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 | |
CustomUserSchema
Schema to represent a CustomUserSchema.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
ID of the user. |
email |
str
|
Email of the user. |
profile_picture |
str
|
Path to the user profile picture. Default=None. |
male |
bool
|
Toggle if user is male. |
user_color |
str
|
Hex value of a user color. |
first_name |
str
|
User first name. |
last_name |
str
|
User last name. |
fullname |
str
|
Full name of user. |
is_superuser |
bool
|
Toggle if user is superuser. |
is_staff |
bool
|
Toggle if user is staff. |
is_active |
bool
|
Toggle if user is active. |
Source code in backend/backend/api.py
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 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 | |
AreaGroup
Views
create_areagroup(request, payload)
The function create_areagroup creates an AreaGroup object.
Endpoint
- Path:
/api/v2/areagroups - Method:
POST
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
payload
|
AreaGroupIn
|
An AreaGroup object to create. |
required |
Returns:
| Type | Description |
|---|---|
int
|
The ID of the newly created AreaGroup object. |
Source code in backend/backend/api.py
911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 | |
get_areagroup(request, areagroup_id)
The function get_areagroup retrieves an AreaGroup object.
Endpoint
- Path:
/api/v2/areagroups/{areagroup_id} - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
areagroup_id
|
int
|
ID of the AreaGroup object to retreive. |
required |
Returns:
| Type | Description |
|---|---|
AreaGroupOut
|
The AreaGroup object. |
Source code in backend/backend/api.py
1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 | |
list_areagroups(request)
The function list_areagroups retrieves a list of AreaGroup objects.
Endpoint
- Path:
/api/v2/areagroups - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
Returns:
| Type | Description |
|---|---|
List[AreaGroupOut]
|
List of AreaGroup objects. |
Source code in backend/backend/api.py
1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 | |
update_areagroup(request, areagroup_id, payload)
The function update_areagroup updates a given AreaGroup object.
Endpoint
- Path:
/api/v2/areagroups/{areagroup_id} - Method:
PUT
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
areagroup_id
|
int
|
ID of the AreaGroup object to update. |
required |
payload
|
AreaGroupIn
|
AreaGroup object with updates to apply. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 | |
delete_areagroup(request, areagroup_id, reassign_to=None)
The function delete_areagroup deletes a given AreaGroup object, moving any
areas that belong to it into another group first.
Area.group is null=True, on_delete=SET_DEFAULT, default=1, which made the
unguarded delete this replaces unsafe in three separate ways:
- Deleting an ordinary group silently moved its areas to group 1 -- no warning, no say in the destination.
- Deleting group 1 set its own areas' group_id to 1, the row being deleted, violating the foreign key.
- Any area left group-less returned 500 from /areas and /chores, because AreaOut.group was non-Optional. (That schema is fixed too, but an area silently losing its group is still wrong.)
The reassignment is therefore explicit and happens before the delete, so SET_DEFAULT never fires at all.
Endpoint
- Path:
/api/v2/areagroups/{areagroup_id} - Method:
DELETE
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
areagroup_id
|
int
|
ID of the AreaGroup object to delete. |
required |
reassign_to
|
int
|
ID of the group to move this group's areas into. Defaults to the lowest-ordered remaining group. |
None
|
Returns:
| Type | Description |
|---|---|
dict
|
|
Source code in backend/backend/api.py
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 | |
Schemas
AreaGroupIn
Schema to represent an AreaGroupIn.
Attributes:
| Name | Type | Description |
|---|---|---|
group_name |
str
|
Area group name. |
group_order |
int
|
Area group order index. Optional; on create, a group with no order given is appended to the end of the list. |
group_color |
str
|
Hex value of area group color. |
Source code in backend/backend/api.py
296 297 298 299 300 301 302 303 304 305 306 307 308 309 | |
AreaGroupOut
Schema to represent an AreaGroupOut.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
ID of area group. |
group_name |
str
|
Area group name. |
group_order |
int
|
Area group order index. |
group_color |
str
|
Hex value of area group color. |
Source code in backend/backend/api.py
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 | |
Area
Views
create_area(request, payload)
The function create_area creates an Area object.
Endpoint
- Path:
/api/v2/areas - Method:
POST
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
payload
|
AreaIn
|
Area Object to create. |
required |
Returns:
| Type | Description |
|---|---|
int
|
ID of the newly created Area object. |
Source code in backend/backend/api.py
940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 | |
get_area(request, area_id)
The function get_area retrieves an Area object.
Endpoint
- Path:
/api/v2/areas/{area_id} - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
area_id
|
int
|
ID of the Area object to retreive. |
required |
Returns:
| Type | Description |
|---|---|
AreaOut
|
The Area object. |
Source code in backend/backend/api.py
1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 | |
list_areas(request)
The function list_areas retrieves a list of Area objects.
Endpoint
- Path:
/api/v2/areas - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
Returns:
| Type | Description |
|---|---|
List[AreaOut]
|
List of Area objects. |
Source code in backend/backend/api.py
1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 | |
update_area(request, area_id, payload)
The function update_area updates a given Area object.
Endpoint
- Path:
/api/v2/areas/{area_id} - Method:
PUT
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
area_id
|
int
|
ID of the Area object to update. |
required |
payload
|
AreaIn
|
Area object with updates to apply. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 | |
delete_area(request, area_id)
The function delete_area deletes a given Area object.
Endpoint
- Path:
/api/v2/areas/{area_id} - Method:
DELETE
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
area_id
|
int
|
ID of the Area object to delete. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 | |
Schemas
AreaIn
Schema to represent an AreaIn.
Attributes:
| Name | Type | Description |
|---|---|---|
area_name |
str
|
Area name. |
area_icon |
str
|
Name of area icon. |
group_id |
int
|
ID of group object area belongs to. |
Source code in backend/backend/api.py
329 330 331 332 333 334 335 336 337 338 339 340 341 | |
AreaOut
Schema to represent an AreaOut.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
ID of an area. |
area_name |
str
|
Area name. |
area_icon |
str
|
Name of area icon. |
group_id |
int
|
ID of group object area belongs to. |
group |
AreaGroupOut
|
Group object area belongs to. |
dirtiness |
int
|
Percentage of dirtiness for the area. |
dueCount |
int
|
Number of chores due for the area. |
overdueCount |
int
|
Number of chores already past their due date. |
totalCount |
int
|
Total number of chores for the area. |
total_dirtiness |
int
|
Total dirtiness of the area. |
Source code in backend/backend/api.py
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 | |
Month
Views
Schemas
MonthOut
Schema to represent a Month.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
ID of the month. |
name |
str
|
Name of the month. |
Source code in backend/backend/api.py
377 378 379 380 381 382 383 384 385 386 387 | |
Chore
Views
create_chore(request, payload)
The function create_chore creates a new Chore object.
Endpoint
- Path:
/api/v2/chores - Method:
POST
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
payload
|
ChoreIn
|
Chore object to create. |
required |
Returns:
| Type | Description |
|---|---|
int
|
ID of the newly created Chore object. |
Source code in backend/backend/api.py
962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 | |
get_chore(request, chore_id)
The function get_chore retrieves an Chore object.
Endpoint
- Path:
/api/v2/chores/{chore_id} - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
chore_id
|
int
|
ID of the Chore object to retreive. |
required |
Returns:
| Type | Description |
|---|---|
ChoreOut
|
The Chore object. |
Source code in backend/backend/api.py
1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 | |
list_chores(request, inactive=False, timeframe=None, assignee_id=None, area_id=None, group_id=None, chore_name=None, overdue=False, sort='due')
The function list_chores retrieves a list of Chore objects.
Endpoint
- Path:
/api/v2/chores - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
inactive
|
bool
|
Toggle retreiving inactive chores. Default=False. |
False
|
timeframe
|
int
|
Days from today to retrieve. Retreives all if None. Default=None. |
None
|
assignee_id
|
int
|
Filter chores by assigned CustomUser ID. Retreives all if None. Default=None. |
None
|
area_id
|
int
|
Filter chores by Area ID. Retreives all if None. Default=None. |
None
|
group_id
|
int
|
Filter chores by the AreaGroup their area belongs to. Default=None. |
None
|
chore_name
|
str
|
Only chores with this name, case-insensitively. Lets one task -- dusting, say -- be worked through every area it exists in. |
None
|
overdue
|
bool
|
Only chores whose due date has already passed. Default=False. |
False
|
sort
|
str
|
One of |
'due'
|
Returns:
| Type | Description |
|---|---|
List[ChoreOut]
|
List of Chore objects. |
Source code in backend/backend/api.py
1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 | |
update_chore(request, chore_id, payload)
The function update_chore updates a given Chore object.
Endpoint
- Path:
/api/v2/chores/{chore_id} - Method:
PUT
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
chore_id
|
int
|
ID of the Chore object to update. |
required |
payload
|
ChoreIn
|
Chore object with updates to apply. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 | |
delete_chore(request, chore_id)
The function delete_chore deletes a given Chore object.
Endpoint
- Path:
/api/v2/chores/{chore_id} - Method:
DELETE
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
chore_id
|
int
|
ID of the Chore object to delete. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 | |
calculate_duedays(next_due)
The function calculate_duedays calculates the days until due based on a given date.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
next_due
|
date
|
The chore next due date. |
required |
Returns:
| Type | Description |
|---|---|
int
|
The number of days until due date. |
Source code in backend/backend/api.py
1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 | |
toggle_chore(request, chore_id, payload)
The function toggle_chore toggles wether a Chore is active/inactive.
Endpoint
- Path:
/api/v2/chores/togglechore/{chore_id} - Method:
PATCH
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
chore_id
|
int
|
ID of the Chore object to update. |
required |
payload
|
ToggleActive
|
ToggleActive schema with status to set for the Chore. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 | |
snooze_chore(request, chore_id, payload)
The function snooze_chore updates a given Chore object's next due date.
Endpoint
- Path:
/api/v2/chores/snoozechore/{chore_id} - Method:
PATCH
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
chore_id
|
int
|
ID of the Chore object to update. |
required |
payload
|
SnoozeChore
|
SnoozeChore schema with nextDue date to update chore with. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 | |
claim_chore(request, chore_id, payload)
The function claim_chore assigns a given Chore object to a user.
Endpoint
- Path:
/api/v2/chores/claimchore/{chore_id} - Method:
PATCH
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
chore_id
|
int
|
ID of the Chore object to update. |
required |
payload
|
ClaimChore
|
ClaimChore schema with a CustomUser ID to assign to chore. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 | |
complete_chore(request, chore_id, payload)
The function complete_chore completes a given Chore object.
Endpoint
- Path:
/api/v2/chores/completechore/{chore_id} - Method:
PATCH
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
chore_id
|
int
|
ID of the Chore object to update. |
required |
payload
|
CompleteChore
|
CompleteChore schema to update Chore with. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 | |
Schemas
ChoreIn
Schema to represent a Chore.
Attributes:
| Name | Type | Description |
|---|---|---|
chore_name |
str
|
Name of the chore. Optional. |
area_id |
int
|
ID of the area. Optional. |
intervalNumber |
int
|
The repeat interval of the chore. Optional. |
unit |
str
|
The repeat unit of the chore. Optional. |
active_months |
List[int]
|
A list of month ids this chore is active. Optional. |
effort |
int
|
The effort required for this chore. Optional. |
nextDue |
date
|
The date chore is next due. Optional. |
lastCompleted |
date
|
The date chore was last completed. Optional. |
assignee_id |
int
|
ID of the assigned user. Optional. |
status |
int
|
ID of the status. Optional. |
Source code in backend/backend/api.py
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 | |
ChoreOut
Schema to represent a Chore.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
ID of the chore. |
chore_name |
str
|
Name of the chore. |
area_id |
int
|
ID of an Area object assigned to the chore. |
area |
AreaOut
|
Area object assigned to the chore. |
nextDue |
date
|
Date chore is next due. |
lastCompleted |
date
|
Date chore was last completed. |
intervalNumber |
int
|
Repeat interval for the chore. |
unit |
str
|
Repeat unit for the chore. |
active_months |
List[int]
|
List of Month ids chode is active. |
assignee_id |
int
|
ID of a user assigned to the chore. Default=None. |
effort |
int
|
Effort required for the chore. |
vacationPause |
bool
|
Due days when paused for vacation. |
expand |
bool
|
Toggle expand menu in UI. |
dirtiness |
int
|
Percentage dirty of the chore. |
duedays |
int
|
Days until chore is due. |
last_three_history_items |
List[LastHistoryItem]
|
List of 3 last history items of the chore. |
status |
int
|
Status ID of the chore. |
Source code in backend/backend/api.py
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 | |
ChoreOutFull
Schema to represent a Chore with full Assigned User and no History.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
ID of the chore. |
chore_name |
str
|
Name of the chore. |
area_id |
int
|
ID of an Area object assigned to the chore. |
area |
AreaOut
|
Area object assigned to the chore. |
nextDue |
date
|
Date chore is next due. |
lastCompleted |
date
|
Date chore was last completed. |
intervalNumber |
int
|
Repeat interval for the chore. |
unit |
str
|
Repeat unit for the chore. |
active_months |
List[int]
|
List of Month ids chode is active. |
assignee_id |
int
|
ID of a user assigned to the chore. Default=None. |
assignee |
CustomUserSchema
|
CustomUser object of the assigned user. Default=None. |
effort |
int
|
Effort required for the chore. |
vacationPause |
bool
|
Due days when paused for vacation. |
expand |
bool
|
Toggle expand menu in UI. |
dirtiness |
int
|
Percentage dirty of the chore. |
duedays |
int
|
Days until chore is due. |
status |
int
|
Status ID of the chore. |
Source code in backend/backend/api.py
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 | |
TogglActive
Schema to toggle a Chore status.
Attributes:
| Name | Type | Description |
|---|---|---|
status |
int
|
ID of a status object. |
Source code in backend/backend/api.py
419 420 421 422 423 424 425 426 427 | |
CompleteChore
Schema to complete a Chore object.
Attributes:
| Name | Type | Description |
|---|---|---|
lastCompleted |
date
|
Date chore was completed. |
completed_by_id |
int
|
ID of the user who completed chore. |
Source code in backend/backend/api.py
430 431 432 433 434 435 436 437 438 439 440 | |
SnoozeChore
Schema to snooze a chore object.
Attributes:
| Name | Type | Description |
|---|---|---|
nextDue |
date
|
Date to set nextDue to. |
Source code in backend/backend/api.py
458 459 460 461 462 463 464 465 466 | |
ClaimChore
Schema to claim a Chore.
Attributes:
| Name | Type | Description |
|---|---|---|
assignee_id |
int
|
ID of a user to assign to chore. Optional. |
Source code in backend/backend/api.py
469 470 471 472 473 474 475 476 477 | |
HistoryItem
Views
create_historyitem(request, payload)
The function create_historyitem creates a new HistoryItem object.
Endpoint
- Path:
/api/v2/historyitems - Method:
POST
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
payload
|
HistoryItemIn
|
HistoryItem object to create. |
required |
Returns:
| Type | Description |
|---|---|
int
|
ID of the newly created HistoryItem object. |
Source code in backend/backend/api.py
999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 | |
get_historyitem(request, historyitem_id)
The function get_historyitem retrieves an HistoryItem object.
Endpoint
- Path:
/api/v2/historyitems/{historyitem_id} - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
historyitem_id
|
int
|
ID of the HistoryItem object to retreive. |
required |
Returns:
| Type | Description |
|---|---|
HistoryItemOut
|
The HistoryItem object. |
Source code in backend/backend/api.py
1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 | |
list_historyitems(request, page=1, page_size=60)
The function list_historyitems retrieves a list of HistoryItem objects.
Endpoint
- Path:
/api/v2/historyitems - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
page
|
int
|
The page of the paginated History Items to return. Default=1. Optional. |
1
|
page_size
|
int
|
The page size of paginated History Items. Default=60. Optional. |
60
|
Returns:
| Type | Description |
|---|---|
PaginatedHistoryItems
|
Paginated List of HistoryItem objects. |
Source code in backend/backend/api.py
1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 | |
update_historyitem(request, historyitem_id, payload)
The function update_historyitem updates a given HistoryItem object.
Endpoint
- Path:
/api/v2/historyitems/{historyitem_id} - Method:
PUT
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
historyitem_id
|
int
|
ID of the HistoryItem object to update. |
required |
payload
|
HistoryItemIn
|
HistoryItem object with updates to apply. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
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 | |
delete_historyitem(request, historyitem_id)
The function delete_historyitem deletes a given HistoryItem object.
Endpoint
- Path:
/api/v2/historyitems/{historyitem_id} - Method:
DELETE
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
historyitem_id
|
int
|
ID of the HistoryItem object to delete. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 | |
Schemas
HistoryItemIn
Schema to represent a HistoryItem.
Attributes:
| Name | Type | Description |
|---|---|---|
completed_date |
date
|
The date the chore was completed. |
completed_by |
str
|
A name of the user who completed the chore. |
chore_id |
int
|
ID of the chore completed. |
Source code in backend/backend/api.py
580 581 582 583 584 585 586 587 588 589 590 591 592 | |
HistoryItemOut
Schema to represent a HistoryItem.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
ID of the HistoryItem. |
completed_date |
date
|
The date the chore was completed. |
completed_by |
CustomUserSchema
|
Object of the user who completed chore. |
chore |
ChoreOutFull
|
Object of the chore completed. |
Source code in backend/backend/api.py
595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 | |
LastHistoryItem
Schema to represent the last History Item for a chore.
Attributes:
| Name | Type | Description |
|---|---|---|
completed_date |
date
|
The date the chore was completed. |
completed_by |
str
|
A name of the user who completed the chore. |
Source code in backend/backend/api.py
480 481 482 483 484 485 486 487 488 489 490 | |
PaginatedHistoryItems
Schema to represent a paginated list of HistoryItems.
Attributes:
| Name | Type | Description |
|---|---|---|
items |
List[HistoryItemOut]
|
List of HistoryItem objects. |
current_page |
int
|
Page number of current record set. |
total_pages |
int
|
Total number of pages. |
total_records |
int
|
Total numboer of HistoryItems. |
Source code in backend/backend/api.py
612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 | |
Option
Views
get_option(request, option_id)
The function get_option retrieves an Option object.
Endpoint
- Path:
/api/v2/options/{option_id} - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
option_id
|
int
|
ID of the Option object to retreive. |
required |
Returns:
| Type | Description |
|---|---|
OptionOut
|
The Option object. |
Source code in backend/backend/api.py
1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 | |
list_options(request)
The function list_options retrieves a list of Option objects.
Endpoint
- Path:
/api/v2/options - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
Returns:
| Type | Description |
|---|---|
List[OptionOut]
|
List of Option objects. |
Source code in backend/backend/api.py
1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 | |
update_option(request, option_id, payload)
The function update_option updates a given Option object.
Endpoint
- Path:
/api/v2/options/{option_id} - Method:
PUT
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
option_id
|
int
|
ID of the Option object to update. |
required |
payload
|
OptionIn
|
Option object with updates to apply. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
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 | |
toggle_vacation(request)
The function toggle_vacation toggles vacation mode.
Endpoint
- Path:
/api/v2/toggle_vacation - Method:
POST
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns success if successful. |
Source code in backend/backend/api.py
865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 | |
Schemas
OptionIn
Schema to represent an Option object.
Attributes:
| Name | Type | Description |
|---|---|---|
vacation_mode |
bool
|
Toggle for vacation mode. |
med_thresh |
int
|
Medium dirtiness threshold. |
high_thresh |
int
|
High dirtiness threshold. |
Source code in backend/backend/api.py
629 630 631 632 633 634 635 636 637 638 639 640 641 | |
OptionOut
Schema to represent an Option object.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
ID of the Option object. |
vacation_mode |
bool
|
Toggle for vacation mode. |
med_thresh |
int
|
Medium dirtiness threshold. |
high_thresh |
int
|
High dirtiness threshold. |
Source code in backend/backend/api.py
644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 | |
Version
Views
list_version(request)
The function list_version retrieves the app version number
from the backend.
Endpoint
- Path:
/api/v2/version/list - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
VersionOut |
VersionOut
|
a version object |
Source code in backend/backend/api.py
1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 | |
Schemas
VersionOut
Schema to represent a Version.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
ID integer. Unique. |
version_number |
str
|
The version of the app. |
Source code in backend/backend/api.py
72 73 74 75 76 77 78 79 80 81 82 | |
Graphs
Views
get_weeklytotals(request, week=0)
The function get_weeklytotals retrieves the weekly totals.
Endpoint
- Path:
/api/v2/weeklytotals - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
week
|
int
|
Flag to indicate if the totals for last week should be retrieved. Default=0. |
0
|
Returns:
| Type | Description |
|---|---|
GraphData
|
The graph data with labels and datasets. |
Source code in backend/backend/api.py
693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 | |
Schemas
DatasetObject
Schema to represent a graph DataSet object.
Attributes:
| Name | Type | Description |
|---|---|---|
backgroundColor |
str
|
Hex value of the graph color. Optional. |
data |
List(int
|
List of object IDs for the graph. |
label |
str
|
Label for the gaph dataset. |
Source code in backend/backend/api.py
662 663 664 665 666 667 668 669 670 671 672 673 674 | |
GraphData
Schema to represent a GraphData object.
Attributes:
| Name | Type | Description |
|---|---|---|
labels |
List[str]
|
List of labels for the graph data. |
datasets |
List[DatasetObject]
|
List of DataSetObject objects. |
title |
str
|
Title of the graph. |
Source code in backend/backend/api.py
678 679 680 681 682 683 684 685 686 687 688 689 690 | |