API
Helpers
invalidate(*keys)
Delete one or more exact cache keys.
Source code in backend/backend/api.py
33 34 35 | |
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
38 39 40 41 42 43 44 45 46 47 48 | |
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
1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 | |
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
704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 | |
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
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 | |
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
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 | |
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
767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 | |
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
877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 | |
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
977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 | |
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
1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 | |
delete_areagroup(request, areagroup_id)
The function delete_areagroup deletes a given AreaGroup object.
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 |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 | |
Schemas
AreaGroupIn
Schema to represent an AreaGroupIn.
Attributes:
| Name | Type | Description |
|---|---|---|
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
244 245 246 247 248 249 250 251 252 253 254 255 256 | |
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
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 | |
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
789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 | |
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
897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 | |
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
1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 | |
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
1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 | |
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
1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 | |
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
276 277 278 279 280 281 282 283 284 285 286 287 288 | |
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. |
totalCount |
int
|
Total number of chores for the area. |
total_dirtiness |
int
|
Total dirtiness of the area. |
Source code in backend/backend/api.py
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 | |
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
318 319 320 321 322 323 324 325 326 327 328 | |
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
811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 | |
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
917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 | |
list_chores(request, inactive=False, timeframe=None, assignee_id=None, area_id=None)
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
|
Returns:
| Type | Description |
|---|---|
List[ChoreOut]
|
List of Chore objects. |
Source code in backend/backend/api.py
1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 | |
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
1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 | |
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
1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 | |
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
1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 | |
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
1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 | |
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
1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 | |
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
1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 | |
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
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 1424 1425 1426 1427 1428 | |
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
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 | |
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
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 | |
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
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 | |
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
360 361 362 363 364 365 366 367 368 | |
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
371 372 373 374 375 376 377 378 379 380 381 | |
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
384 385 386 387 388 389 390 391 392 | |
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
395 396 397 398 399 400 401 402 403 | |
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
848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 | |
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
937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 | |
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
1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 | |
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
1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 | |
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
1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 | |
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
506 507 508 509 510 511 512 513 514 515 516 517 518 | |
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
521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 | |
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
406 407 408 409 410 411 412 413 414 415 416 | |
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
538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 | |
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
957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 | |
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
1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 | |
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
1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 | |
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
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 | |
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
555 556 557 558 559 560 561 562 563 564 565 566 567 | |
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
570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 | |
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
1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 | |
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
58 59 60 61 62 63 64 65 66 67 68 | |
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
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 | |
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
588 589 590 591 592 593 594 595 596 597 598 599 600 | |
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
604 605 606 607 608 609 610 611 612 613 614 615 616 | |