calendar data
This commit is contained in:
@@ -138,6 +138,26 @@ def hello_world():
|
|||||||
|
|
||||||
return jsonify(action_data="sent", select_pending=array3)
|
return jsonify(action_data="sent", select_pending=array3)
|
||||||
|
|
||||||
|
@app.route("/test/calendar")
|
||||||
|
def test_calen():
|
||||||
|
dList = []
|
||||||
|
sample_range = random.randint(20, 60)
|
||||||
|
for x in range(sample_range):
|
||||||
|
calDate = datetime.datetime.utcnow() + datetime.timedelta(minutes=180 * random.randint(1, 20))
|
||||||
|
new_l = {"uid":"425611f2-c692-4404-b93d-76ca7a5ce7"+str(x), "description": "Calendar Random Item on " + str(x) , "added": calDate, "category":random.randint(1, 4) }
|
||||||
|
dList.append(new_l)
|
||||||
|
|
||||||
|
calendar_data = {
|
||||||
|
"last_update": datetime.datetime.utcnow(),
|
||||||
|
"category": [
|
||||||
|
{"cid": "1", "description": "category 01" },
|
||||||
|
{"cid": "2", "description": "category 02" },
|
||||||
|
{"cid": "3", "description": "category 03" },
|
||||||
|
{"cid": "4", "description": "category 04" },
|
||||||
|
],
|
||||||
|
"list" : dList
|
||||||
|
}
|
||||||
|
return jsonify(calendar_data=calendar_data)
|
||||||
|
|
||||||
@app.route("/test/products")
|
@app.route("/test/products")
|
||||||
def test_product():
|
def test_product():
|
||||||
@@ -648,7 +668,14 @@ def recent_bar(current_user):
|
|||||||
@token_required
|
@token_required
|
||||||
def calendar_data(current_user):
|
def calendar_data(current_user):
|
||||||
# let send 60 days of data in only - cache heavy
|
# let send 60 days of data in only - cache heavy
|
||||||
bar_data = {
|
dList = []
|
||||||
|
sample_range = random.randint(20, 60)
|
||||||
|
for x in range(sample_range):
|
||||||
|
calDate = datetime.datetime.utcnow() + datetime.timedelta(minutes=180 * random.randint(1, 20))
|
||||||
|
new_l = {"uid":"425611f2-c692-4404-b93d-76ca7a5ce7"+str(x), "description": "Calendar Random Item on " + str(x) , "added": calDate, "category":random.randint(1, 4) }
|
||||||
|
dList.append(new_l)
|
||||||
|
|
||||||
|
calendar_data = {
|
||||||
"last_update": datetime.datetime.utcnow(),
|
"last_update": datetime.datetime.utcnow(),
|
||||||
"category": [
|
"category": [
|
||||||
{"cid": "1", "description": "category 01" },
|
{"cid": "1", "description": "category 01" },
|
||||||
@@ -656,14 +683,9 @@ def calendar_data(current_user):
|
|||||||
{"cid": "3", "description": "category 03" },
|
{"cid": "3", "description": "category 03" },
|
||||||
{"cid": "4", "description": "category 04" },
|
{"cid": "4", "description": "category 04" },
|
||||||
],
|
],
|
||||||
"list": [
|
"list" : dList
|
||||||
{"id": "1", "description": "Contacts" , "last_update": "10-10-2010 11:00 AM", "value": random.randint(0, 10) , "data_span":'Last 2 months'},
|
|
||||||
{"id": "2", "description": "Site Traffic" , "last_update": "10-10-2010 11:30 AM", "value": random.randint(0, 10), "data_span":'Past 12 hours'},
|
|
||||||
{"id": "3", "description": "Appointments" , "last_update": "10-12-2010 11:30 AM", "value": random.randint(0, 10), "data_span":'Last 14 days'},
|
|
||||||
{"id": "4", "description": "Purchases" , "last_update": "10-12-2010 11:30 AM", "value": random.randint(0, 10), "data_span":'Last 3 months'},
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
return jsonify(bar_data=bar_data)
|
return jsonify(bar_data=calendar_data)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/panel/account/actions")
|
@app.route("/panel/account/actions")
|
||||||
|
|||||||
Reference in New Issue
Block a user