def _build_task_query(): filter_params = [{ "property": "completed_on", "comparator": "date_is", "value_type": "today" }, { "property": "completed_on", "comparator": "is_empty", "value_type": "exact_date" }] return tasksDatabase().build_query(filter=filter_params, filter_operator="or")
def add_task(): try: task = request.args.get('title') collection = tasksDatabase().collection row = collection.add_row() row.name = task row.status = 'Next Up' row.tags = [importedTagURL()] return 'Succeceed in adding task', 200 except Exception: return 'Failed in adding task', 500
def add_photo(): try: task = request.args.get('title') url = request.args.get('url') collection = tasksDatabase().collection row = collection.add_row() row.name = task row.status = 'Inbox' row.photo = url return 'Succeceed in adding photo', 200 except Exception: return 'Failed in adding photo', 500
def add_email(): try: task = request.args.get('title') url = request.args.get('url') intro = request.args.get('intro') collection = tasksDatabase().collection row = collection.add_row() row.name = task row.status = 'Inbox' row.url = url row.children.add_new(TextBlock, title=intro) return 'Succeceed in adding task', 200 except Exception: return 'Failed in adding task', 500