added select
This commit is contained in:
@@ -946,6 +946,15 @@ def addProvisionAction(member_id,product_uid,action):
|
||||
@app.route("/panel/contacts")
|
||||
@token_required
|
||||
def site_contacts(current_user):
|
||||
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:
|
||||
cursor.execute(SUPPORTED_CATEGORY)
|
||||
select_Res = cursor.fetchall()
|
||||
|
||||
print(select_Res)
|
||||
contacts_category = json.dumps( [dict(ix) for ix in select_Res] )
|
||||
print(contacts_category)
|
||||
|
||||
dList = []
|
||||
sample_range = random.randint(20, 60)
|
||||
@@ -962,6 +971,7 @@ def site_contacts(current_user):
|
||||
|
||||
calendar_data = {
|
||||
"last_update": datetime.datetime.utcnow(),
|
||||
"category" : contacts_category,
|
||||
"contacts" : dList
|
||||
}
|
||||
return jsonify(calendar_data=calendar_data)
|
||||
|
||||
Reference in New Issue
Block a user