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:
@ -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()
|
||||
|
||||
Reference in New Issue
Block a user