/consulta. You can narrow results by municipality name and date to quickly locate specific observations, making it straightforward to audit past readings or prepare data for the comparison tool.
How to access
Navigate to/consulta using the Histórico link in the navigation bar, or visit the route directly. On a GET request the page loads with all stored records displayed. Apply filters using the form to reduce the result set.
Filtering options
The query form accepts two optional filters. You can use either one alone or combine them.Municipality
A free-text search against the
municipio field. The match is case-insensitive and uses substring matching, so entering mad will match Madrid. Accents and capitalisation are normalised before comparison.Date
Enter the date in YYYY-MM-DD format using the date picker in the form. The controller converts this to
DD/MM/YYYY internally before querying the stored records, which always use the DD/MM/YYYY format.What the results show
Each matching record is rendered as a row in the results table. The following fields are displayed:How filtering works under the hood
The/consulta route is handled by view_controller.py. On a POST request it reads the form values, converts the date format, and calls filter_records() — a thin wrapper around JSONRepository.filtrar_registros().
The repository applies the three available filters sequentially:
fuente filter is not exposed in the query form but is used internally by the comparison tool to isolate manual records.
If no filters are applied, the page displays every record currently stored in
data/registros_climaticos.json. For large datasets, apply at least a municipality or date filter to keep the result set manageable.