Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created December 15, 2018 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/54e208294b686f7399c0c9a6f56c4d1f to your computer and use it in GitHub Desktop.
Save parzibyte/54e208294b686f7399c0c9a6f56c4d1f to your computer and use it in GitHub Desktop.
def insertar(producto):
base_de_datos = obtener_bd()
productos = base_de_datos.productos
return productos.insert_one({
"nombre": producto.nombre,
"precio": producto.precio,
"cantidad": producto.cantidad,
}).inserted_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment