diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 8954636..7bb04a5 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,27 +4,20 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
@@ -39,17 +32,21 @@
- {
+ "keyToString": {
+ "Python.app.executor": "Run",
+ "RunOnceActivity.OpenProjectViewOnStart": "true",
+ "RunOnceActivity.ShowReadmeOnStart": "true",
+ "git-widget-placeholder": "Fernanda",
+ "last_opened_file_path": "C:/5_11/SEDECODE/ecommerce/models",
+ "node.js.detected.package.eslint": "true",
+ "node.js.selected.package.eslint": "(autodetect)",
+ "node.js.selected.package.tslint": "(autodetect)",
+ "nodejs_package_manager_path": "npm",
+ "settings.editor.selected.configurable": "preferences.language.and.region",
+ "vue.rearranger.settings.migration": "true"
}
-}]]>
+}
@@ -60,7 +57,8 @@
-
+
+
@@ -75,10 +73,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Laboratorio IV/.dockerignore b/Laboratorio IV/.dockerignore
new file mode 100644
index 0000000..3dbbcf3
--- /dev/null
+++ b/Laboratorio IV/.dockerignore
@@ -0,0 +1,25 @@
+**/.classpath
+**/.dockerignore
+**/.env
+**/.git
+**/.gitignore
+**/.project
+**/.settings
+**/.toolstarget
+**/.vs
+**/.vscode
+**/*.*proj.user
+**/*.dbmdl
+**/*.jfm
+**/bin
+**/charts
+**/docker-compose*
+**/compose*
+**/Dockerfile*
+**/node_modules
+**/npm-debug.log
+**/obj
+**/secrets.dev.yaml
+**/values.dev.yaml
+LICENSE
+README.md
diff --git a/Laboratorio IV/Dockerfile b/Laboratorio IV/Dockerfile
new file mode 100644
index 0000000..6b9fbb2
--- /dev/null
+++ b/Laboratorio IV/Dockerfile
@@ -0,0 +1,4 @@
+FROM docker/whalesay:latest
+LABEL Name=laboratorioiv Version=0.0.1
+RUN apt-get -y update && apt-get install -y fortunes
+CMD ["sh", "-c", "/usr/games/fortune -a | cowsay"]
diff --git a/Laboratorio IV/Fernanda Segovia/C 1/Dockerfile b/Laboratorio IV/Fernanda Segovia/C 1/Dockerfile
new file mode 100644
index 0000000..df0e8d5
--- /dev/null
+++ b/Laboratorio IV/Fernanda Segovia/C 1/Dockerfile
@@ -0,0 +1,39 @@
+version: "3.8"
+
+services:
+
+ postgres:
+ image: postgres
+ container_name: ${CONTAINER_NAME}
+ ports:
+ - "5432:5432"
+ environment:
+ - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
+ - POSTGRES_USER=${POSTGRES_USER}
+ - POSTGRES_DB=${POSTGRES_DB}
+ - POSTGRES_HOST=${POSTGRES_HOST}
+ volumes:
+ - postgres-data:/var/lib/postgresql/data
+
+
+volumes:
+ postgres-data:version: "3.8"
+
+services:
+
+ postgres:
+ image: postgres
+ container_name: ${CONTAINER_NAME}
+ ports:
+ - "5432:5432"
+ environment:
+ - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
+ - POSTGRES_USER=${POSTGRES_USER}
+ - POSTGRES_DB=${POSTGRES_DB}
+ - POSTGRES_HOST=${POSTGRES_HOST}
+ volumes:
+ - postgres-data:/var/lib/postgresql/data
+
+
+volumes:
+ postgres-data:
\ No newline at end of file
diff --git a/Laboratorio IV/Fernanda Segovia/C 1/cursor.py b/Laboratorio IV/Fernanda Segovia/C 1/cursor.py
new file mode 100644
index 0000000..59cfdcc
--- /dev/null
+++ b/Laboratorio IV/Fernanda Segovia/C 1/cursor.py
@@ -0,0 +1,27 @@
+import psycopg2
+from contextlib import contextmanager
+from dotenv import load_dotenv
+import os
+
+load_dotenv()
+
+
+@contextmanager
+def CursorDelPool():
+ # Obtener la configuración de la conexión desde las variables de entorno
+ conn_params = {
+ 'host': os.getenv('DB_HOST'),
+ 'port': os.getenv('DB_PORT'),
+ 'dbname': os.getenv('DB_NAME'),
+ 'user': os.getenv('DB_USER'),
+ 'password': os.getenv('DB_PASSWORD')
+ }
+
+ # Conectar a la base de datos
+ conn = psycopg2.connect(**conn_params)
+ try:
+ cursor = conn.cursor()
+ yield cursor
+ finally:
+ cursor.close()
+ conn.close()
diff --git a/Laboratorio IV/Fernanda Segovia/C 1/logger.py b/Laboratorio IV/Fernanda Segovia/C 1/logger.py
new file mode 100644
index 0000000..8a8e0b7
--- /dev/null
+++ b/Laboratorio IV/Fernanda Segovia/C 1/logger.py
@@ -0,0 +1,9 @@
+import logging as log
+
+log.basicConfig(level=log.INFO,
+ format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
+ datefmt='%I:%M:%S %p',
+ handlers=[
+ log.FileHandler('logs/logfile.log', encoding='utf-8'),
+ log.StreamHandler()
+ ])
\ No newline at end of file
diff --git a/Laboratorio IV/Fernanda Segovia/C 1/menu.py b/Laboratorio IV/Fernanda Segovia/C 1/menu.py
new file mode 100644
index 0000000..78cd317
--- /dev/null
+++ b/Laboratorio IV/Fernanda Segovia/C 1/menu.py
@@ -0,0 +1,10 @@
+opcion = None
+
+while opcion != "5":
+ print('Opciones:')
+ print('1. Listar Usuarios')
+ print('2. Agregar usuario')
+ print('3. Editar usuario')
+ print('4. Eliminar usuario')
+ print('5. Salir')
+ opcion = int(input('Digite un numero de las opciones:'))
\ No newline at end of file
diff --git a/Laboratorio IV/Fernanda Segovia/C 1/usuario.py b/Laboratorio IV/Fernanda Segovia/C 1/usuario.py
new file mode 100644
index 0000000..3133890
--- /dev/null
+++ b/Laboratorio IV/Fernanda Segovia/C 1/usuario.py
@@ -0,0 +1,64 @@
+class Usuario:
+ def __init__(self, id_usuario: None, username: None, password: None):
+ self.id_usuario = id_usuario
+ self.username = username
+ self.password = password
+
+ def __str__(self):
+ return f"Usuario {self.id_usuario} - {self.username} - {self.password}"
+
+ @property
+ def id_usuario(self):
+ return self.id_usuario
+
+ @id_usuario.setter
+ def id_usuario(self, id_usuario):
+ self.id_usuario = id_usuario
+
+ @property
+ def username(self):
+ return self.username
+
+ @username.setter
+ def username(self, username):
+ self.username = username
+
+ @property
+ def password(self):
+ return self.password
+
+ @password.setter
+ def password(self, password):
+ self.password = passwordclassUsuario
+ def __init__(self, id_usuario: None, username: None, password: None):
+ self.id_usuario = id_usuario
+ self.username = username
+ self.password = password
+
+ def __str__(self):
+ return f"Usuario {self.id_usuario} - {self.username} - {self.password}"
+
+ @property
+ def id_usuario(self):
+ return self.id_usuario
+
+ @id_usuario.setter
+ def id_usuario(self, id_usuario):
+ self.id_usuario = id_usuario
+
+ @property
+ def username(self):
+ return self.username
+
+ @username.setter
+ def username(self, username):
+ self.username = username
+
+ @property
+ def password(self):
+ return self.password
+
+ @password.setter
+ def password(self, password):
+ self.password = password
+
\ No newline at end of file