From 565b2ba11ea3afd1084f09991a60fe4fa03876a1 Mon Sep 17 00:00:00 2001 From: gthampi Date: Fri, 1 Sep 2023 17:24:00 -0400 Subject: [PATCH] get lists (by list_category) --- lists.py | 13 +++++++++++++ myspace_api.py | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 lists.py diff --git a/lists.py b/lists.py new file mode 100644 index 0000000..79bccef --- /dev/null +++ b/lists.py @@ -0,0 +1,13 @@ +from flask import request +from flask_restful import Resource + +from data_pm import connect + + +class List(Resource): + def get(self): + response = {} + where = request.args.to_dict() + with connect() as db: + response = db.select('lists', where) + return response diff --git a/myspace_api.py b/myspace_api.py index ee41fbc..322dac2 100644 --- a/myspace_api.py +++ b/myspace_api.py @@ -28,6 +28,7 @@ from maintenance import MaintenanceStatusByProperty, MaintenanceByProperty, MaintenanceStatusByOwner, MaintenanceRequestsByOwner, MaintenanceRequests from contacts import ContactsMaintenance, ContactsOwnerContactsDetails, ContactsBusinessContacts, ContactsBusinessContactsOwnerDetails, ContactsBusinessContactsTenantDetails, ContactsBusinessContactsMaintenanceDetails from settings import Account +from lists import List # from refresh import Refresh # from data import connect, disconnect, execute, helper_upload_img, helper_icon_img from data_pm import connect, uploadImage, s3 @@ -416,7 +417,7 @@ def get(self, tenant_id): api.add_resource(ContactsBusinessContactsTenantDetails, '/contactsBusinessContactsTenantDetails/') api.add_resource(ContactsBusinessContactsMaintenanceDetails, '/contactsBusinessContactsMaintenanceDetails/') - +api.add_resource(List, '/lists') api.add_resource(Account, '/account') api.add_resource(TenantDashboard, '/tenantDashboard/')