Added the create project and item functions for the mark a course as completed app. Reorganized a bit and added classes for the project as well.

This commit is contained in:
Norm Rasmussen
2024-08-31 08:26:18 -04:00
parent 6936530289
commit e49d3d0a01
8 changed files with 152 additions and 5 deletions

View File

@ -123,12 +123,24 @@ def get_all_projects():
"""
Returns all projects.
"""
project_ids = []
url = f"{BASEURL}/projects"
ret = Calls.get(url)
for items in ret["data"]:
project_ids.append(items['id'])
print(f"{ items['attributes']['name'] } -- { items['id'] }")
return project_ids
def delete_all_projects():
"""
Deletes all projects after returning the uuids of the projects currently available.
"""
project_ids = get_all_projects()
for proj in project_ids:
url = f"{BASEURL}/projects/{proj}"
Calls.delete(url)
def get_specific_project():
"""
@ -140,6 +152,7 @@ def get_specific_project():
if __name__ == "__main__":
# delete_all_projects()
# read_json_docs()
# create_project()
get_all_projects()