Esempio n. 1
0
def _convert_lb_to_internal(lb_c):
    """Don't expose the external model to the sqlalchemy ORM model."""
    lb_m = models.LogBook(uuid=lb_c.uuid, meta=lb_c.meta, name=lb_c.name)
    lb_m.flowdetails = []
    for fd_c in lb_c:
        lb_m.flowdetails.append(_convert_fd_to_internal(fd_c, lb_c.uuid))
    return lb_m
Esempio n. 2
0
def logbook_create(name, lb_id=None):
    """Creates a new LogBook model with matching lb_id"""
    # Create a LogBook model to save
    lb_ref = models.LogBook()
    # Update attributes of the LogBook model
    lb_ref.name = name
    if lb_id:
        lb_ref.logbook_id = lb_id
    # Save the LogBook to the database
    lb_ref.save()
Esempio n. 3
0
def _convert_lb_to_internal(lb_c):
    lb_m = models.LogBook(uuid=lb_c.uuid, meta=lb_c.meta, name=lb_c.name)
    lb_m.flowdetails = []
    for fd_c in lb_c:
        lb_m.flowdetails.append(_convert_fd_to_internal(fd_c, lb_c.uuid))
    return lb_m