Exemplo n.º 1
0
def tasks_edit(task_id):
    task = get_task_by_id(task_id)
    url_for_redirect = get_parameter()

    if task.get('calendar_date') is not None:
        obj_date = datetime.strptime(task.get('calendar_date'),
                                     "%Y-%m-%d %H:%M:%S")
    else:
        obj_date = datetime.now()

    form = task_preset_form.format(year=obj_date.year,
                                   month=obj_date.month,
                                   day=obj_date.day,
                                   hour=obj_date.hour,
                                   redirect=url_for_redirect)

    # make calendar date hidden
    if task.get('calendar_date') is None:
        form = form.replace('checked="checked"', '')

    # set name of task
    form = form.replace('</textarea>', task.get('name') + '</textarea>')
    # set id of task
    form = form.replace('[task_id]', str(task_id))
    # send request to tasks_editor
    form = form.replace('[task_creator_link]', task_editor_link)

    return form
Exemplo n.º 2
0
def tasks_add():
    _today = datetime.now()
    url_for_redirect = get_parameter()

    form = task_preset_form.format(year=request.args.get('y', _today.year),
                                   month=request.args.get('m', _today.month),
                                   day=request.args.get('d', _today.day),
                                   hour=request.args.get('h', _today.hour),
                                   redirect=url_for_redirect)
    # make calendar date hidden
    if request.args.get('calendar', '1') == '0':
        form = form.replace('checked="checked"', '')

    # send request to tasks_creator
    form = form.replace('[task_creator_link]', task_creator_link)
    return form
def products_table_name():
    """
    Products DynamoDB table name
    """

    return get_parameter("/ecommerce/{Environment}/products/table/name")
def event_bus_name():
    """
    Event Bus name
    """

    return get_parameter("/ecommerce/{Environment}/platform/event-bus/name")
def orders_table_name():
    return get_parameter("/ecommerce/{Environment}/orders/table/name")
def api_id():
    """
    Frontend GraphQL API ID
    """

    return get_parameter("/ecommerce/{Environment}/frontend-api/api/id")
def delivery_table_name():
    """
    Delivery DynamoDB table name
    """

    return get_parameter("/ecommerce/{Environment}/delivery/table/name")
def payment_3p_api_url():
    return get_parameter("/ecommerce/{Environment}/payment-3p/api/url")
Exemplo n.º 9
0
def delivery_api_url():
    return get_parameter("/ecommerce/{Environment}/delivery-pricing/api/url")
Exemplo n.º 10
0
def user_pool_id():
    return get_parameter("/ecommerce/{Environment}/users/user-pool/id")
Exemplo n.º 11
0
def frontend_api_url():
    return get_parameter("/ecommerce/{Environment}/frontend-api/api/url")
Exemplo n.º 12
0
def products_table():
    # TODO: replace data manipulation with backoffice API calls
    table_name = get_parameter("/ecommerce/{Environment}/products/table/name")
    return boto3.resource("dynamodb").Table(table_name)  # pylint: disable=no-member
def listener_api_url():
    return get_parameter("/ecommerce/{Environment}/platform/listener-api/url")
Exemplo n.º 14
0
def table():
    table_name = get_parameter("/ecommerce/{Environment}/payment/table/name")
    dynamodb = boto3.resource("dynamodb")
    return dynamodb.Table(table_name) # pylint: disable=no-member
def orders_table_name():
    """
    Orders DynamoDB table name
    """

    return get_parameter("/ecommerce/{Environment}/orders/table/name")
Exemplo n.º 16
0
def product_table_name():
    return get_parameter("/ecommerce/{Environment}/products/table/name")
def delivery_pricing_api_url():
    """
    Delivery Pricing API
    """

    return get_parameter("/ecommerce/{Environment}/delivery-pricing/api/url")
Exemplo n.º 18
0
def function_arn():
    return get_parameter("/ecommerce/{Environment}/orders/create-order/arn")
def warehouse_table_name():
    """
    Warehouse DynamoDB table name
    """

    return get_parameter("/ecommerce/{Environment}/warehouse/table/name")
def endpoint_url():
    """
    API Gateway Endpoint URL
    """

    return get_parameter("/ecommerce/{Environment}/orders/api/url")
def user_pool_id():
    """
    Cognito User Pool ID
    """

    return get_parameter("/ecommerce/{Environment}/users/user-pool/id")
def delivery_table_name():
    return get_parameter("/ecommerce/{Environment}/delivery/table/name")
def api_url():
    """
    Frontend GraphQL API URL
    """

    return get_parameter("/ecommerce/{Environment}/frontend-api/api/url")
def endpoint_url():
    return get_parameter("/ecommerce/{Environment}/products/api/url")