Wert App stores all persistent data in a MySQL database namedDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/lucavallini/wert-app/llms.txt
Use this file to discover all available pages before exploring further.
registro_usuarios. The schema contains two tables: usuarios, which holds user credentials, and notas, which holds per-user notes and references usuarios via a foreign key. All database interactions go through the DatabaseManager class in database/db_operations.py, which accepts an open connection in its constructor and exposes a focused set of methods for registration, authentication, and note management.
Schema
usuarios table
Stores one row per registered user. The username column carries a UNIQUE constraint so duplicate registrations are rejected at the database level before the application layer checks.
| Column | Type | Constraints |
|---|---|---|
id | INT | AUTO_INCREMENT, PRIMARY KEY |
username | VARCHAR(50) | NOT NULL, UNIQUE |
password | VARCHAR(255) | NOT NULL |
notas table
Stores notes belonging to a user. The id column is a foreign key to usuarios.id. A composite UNIQUE(id, titulo) constraint prevents the same user from saving two notes with identical titles.
| Column | Type | Constraints |
|---|---|---|
id_nota | INT | AUTO_INCREMENT, PRIMARY KEY |
titulo | VARCHAR(255) | — |
nota | TEXT | — |
id | INT | FOREIGN KEY → usuarios.id |
| — | — | UNIQUE (id, titulo) |
DatabaseManager class
DatabaseManager is defined in database/db_operations.py. It is instantiated once in ventanaLogin.__init__ and the same instance is passed to every child window, so a single connection and cursor are reused for the lifetime of the session.
The connection is opened externally via
getConexion() in conexion.py and passed into the constructor. DatabaseManager does not open or close the connection itself — the calling code (in logica_login.py) owns the connection lifecycle.Method reference
setRegister
Inserts a new row into usuarios.
The username to register. Must be unique; a
mysql.connector.Error is raised if it already exists.The password string to store. The application layer is responsible for any hashing before this call.
getLogin
Looks up a user by username and password and returns their id and username on a successful match.
The username submitted in the login form.
The password submitted in the login form.
(id, username) tuple on success, or None if no matching row is found.
getUser
Checks whether a username is already registered. Used by ventanaRegister before calling setRegister.
The username to look up.
(username,) tuple if the user exists, or None if not.
setNote
Inserts a new note row for the given user. The composite unique constraint on (id, titulo) will raise an error if the user already has a note with the same title.
The
id of the authenticated user, obtained from getId.The note title. Must be unique per user.
The full text body of the note.
getTitles
Retrieves every note title belonging to a user. Used to populate the notes combo box in ventanaMain.
The numeric user
id (not the username string).(titulo,) tuples, or an empty list if the user has no notes.
getNoteContent
Fetches the text body of a single note identified by user id and title.
The numeric user
id.The exact title of the note to retrieve.
(nota,) tuple, or None if no matching note exists.
deleteNote
Deletes a note row identified by user id and title.
The numeric user
id.The title of the note to delete.
getId
Returns the numeric id for a given username. Called in ventanaMain.__init__ to resolve the username string received from the login window into the integer primary key used by all note methods.
The username string to look up.
(id,) tuple, or None if the username does not exist.