From 6139666ef79bf88f33df87a7e5c6e81d7ae9d916 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sat, 25 Jan 2025 08:53:54 -0500 Subject: [PATCH] cat list --- services/web/project/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/web/project/__init__.py b/services/web/project/__init__.py index 28fd30f..4da2e52 100644 --- a/services/web/project/__init__.py +++ b/services/web/project/__init__.py @@ -946,6 +946,7 @@ def addProvisionAction(member_id,product_uid,action): @app.route("/panel/contacts") @token_required def site_contacts(current_user): + cat_list = ['A000002','A000004','A000001','A000003'] SUPPORTED_CATEGORY = "SELECT name AS title,product_id from products WHERE product_id IN ('A000002','A000004','A000001','A000003')" with connection: with connection.cursor(cursor_factory=psycopg2.extras.DictCursor) as cursor: @@ -955,6 +956,7 @@ def site_contacts(current_user): print(select_Res) contacts_category = json.dumps( [dict(ix) for ix in select_Res] ) print(contacts_category) + array_cat = json.loads(contacts_category) dList = [] sample_range = random.randint(20, 60) @@ -963,6 +965,7 @@ def site_contacts(current_user): new_l = { "uid":"425611f2-c692-4404-b93d-76ca7a5ce7"+str(x), "title": "Calendar Random Item on " + str(x) , + "category" : cat_list[ random.randint(0, 3) ], "added": calDate, "sender": "Firstname Lastname" + str(random.randint(1, 4)), "message" : dummy_message() @@ -971,7 +974,7 @@ def site_contacts(current_user): calendar_data = { "last_update": datetime.datetime.utcnow(), - "category" : contacts_category, + "category" : array_cat, "contacts" : dList } return jsonify(calendar_data=calendar_data)