1
2
3
4
5
6
>>> p = models.product.get_product_by_id(request.dbsession, "113fb5e4-b46b-11e9-9885-606720")
>>> u = models.user.get_user_by_email(request.dbsession, "<removed>@gmail.com")
>>> p.add_user_to_product(u)
>>> request.dbsession.add(p)
>>> request.dbsession.flush()
>>> request.tm.commit()