Beispiel #1
0
def create_epics_in_bulk(bulk_data, callback=None, precall=None, **additional_fields):
    """Create epics from `bulk_data`.

    :param bulk_data: List of epics in bulk format.
    :param callback: Callback to execute after each epic save.
    :param additional_fields: Additional fields when instantiating each epic.

    :return: List of created `Epic` instances.
    """
    epics = get_epics_from_bulk(bulk_data, **additional_fields)

    disconnect_epics_signals()

    try:
        db.save_in_bulk(epics, callback, precall)
    finally:
        connect_epics_signals()

    return epics
Beispiel #2
0
def create_epics_in_bulk(bulk_data, callback=None, precall=None, **additional_fields):
    """Create epics from `bulk_data`.

    :param bulk_data: List of epics in bulk format.
    :param callback: Callback to execute after each epic save.
    :param additional_fields: Additional fields when instantiating each epic.

    :return: List of created `Epic` instances.
    """
    epics = get_epics_from_bulk(bulk_data, **additional_fields)

    disconnect_epics_signals()

    try:
        db.save_in_bulk(epics, callback, precall)
    finally:
        connect_epics_signals()

    return epics