Accessing the Records Page
You can navigate to the records page in two ways:- From the home page, click the ”📜 Ver Registros” (View Records) button
- Navigate directly to the
/registrosroute in your browser
registros() function (app.py:130-133), which loads all records from the CSV database and displays them in a structured table.
Understanding the Records Table
The records table displays the following columns for each entry:All records are stored in
data/registros.csv and loaded dynamically when you access the page.Table Columns
| Column | Description |
|---|---|
| ID | Unique sequential identifier for each record |
| Imagen | Thumbnail preview of the uploaded license plate image |
| Matrícula | The detected license plate number (extracted via AI/OCR) |
| Propietario | Owner name or identifier (if provided during upload) |
| Tipo | Vehicle type classification (e.g., sedan, truck, motorcycle) |
| Obs. | Additional observations or notes about the vehicle |
| Actions | Delete button for removing individual records |
Image Thumbnails
Each record displays a thumbnail of the original uploaded image. The thumbnails are served from theuploads/ directory via the /uploads/<filename> route (app.py:149-151).
Managing Individual Records
Deleting a Record
To remove a record from the system:Locate the Record
Find the record you want to delete in the table. Use the ID, license plate number, or image thumbnail to identify it.
Click the Delete Icon
Click the delete icon (trash can) in the rightmost column of the record’s row. This icon is rendered as
delete.svg from the static assets.Record deletion is permanent and cannot be undone. The delete operation removes both the database entry and the physical image file (app.py:135-147).
Records Page Features
Automatic Refresh
The records page loads fresh data from the CSV file each time you visit, ensuring you always see the most up-to-date information.Flash Messages
The page displays flash messages at the top to inform you of:- Successful record deletions
- Any errors that occur during operations
- Status updates from other operations
- Green background for success messages (category: “ok”)
- Red/warning background for error messages (category: “error”)
Empty State
If no records exist in the system:- The table will display with headers but no data rows
- You can return to the home page to add your first record
- The CSV file will contain only the header row
Navigation Options
The records page provides two primary navigation buttons:Return to Upload
Click the ”⬅ Volver” (Back) button to return to the main upload interface where you can add new license plate records.Export to CSV
Click the “Descargar CSV” (Download CSV) button to export all records to a CSV file. This is covered in detail in the Exporting Data guide.Database Structure
Records are stored in a CSV file with the following structure:- id: Sequential numeric identifier
- fecha_hora: Timestamp in “YYYY-MM-DD HH:MM:SS” format
- matricula: Detected license plate text
- propietario: Optional owner information
- tipo_vehiculo: Optional vehicle type
- observacion: Optional additional notes
- imagen: Filename of the stored image
The CSV file is created automatically on first use (app.py:26-29) with proper headers to ensure data integrity.
Record Filtering and Search
Currently, the records table displays all entries in the database. For large datasets:- Records are displayed in the order they appear in the CSV file
- You can use your browser’s built-in search (Ctrl+F or Cmd+F) to find specific entries
- For advanced filtering, consider exporting to CSV and using spreadsheet software
Performance Considerations
Large Datasets
The current implementation loads all records into memory when rendering the page. For systems with hundreds or thousands of records:- Page load time may increase with more records
- Consider implementing pagination for better performance
- The CSV file size grows with each new record
Image Storage
All uploaded images are stored in theuploads/ directory:
- Each image is saved with a unique timestamped filename
- Images are retained even if the server restarts
- Deleted records also remove their associated image files to conserve disk space
Troubleshooting
Records Not Displaying
If the records page loads but shows no data:- Verify that
data/registros.csvexists and contains data - Check that the CSV file has the correct headers
- Ensure the Flask application has read permissions for the data directory
Images Not Loading
If thumbnails show broken image icons:- Verify the
uploads/directory exists and contains the referenced files - Check that image filenames in the CSV match actual files in
uploads/ - Ensure the Flask application has read permissions for the uploads directory
Delete Not Working
If clicking delete doesn’t remove records:- Verify the Flask application has write permissions for both the CSV file and uploads directory
- Check browser console for any JavaScript errors
- Ensure the record ID exists in the database
