feat: implementar ABM completo de comisiones, carreras y asignaturas con proteccion de integridad y corregir edificios y campus virtual

This commit is contained in:
2026-09-23 19:53:27 -03:00
parent 195bfd915e
commit 165a0b65b8
13 changed files with 1033 additions and 154 deletions
+5 -2
View File
@@ -32,15 +32,18 @@ def list_buildings():
buildings = query.order_by(Building.name.asc()).all()
# Calculate global building stats
# Calculate global building stats (excluye aulas virtuales con 9999)
total_classrooms = Classroom.query.filter_by(is_active=True).count()
total_capacity = sum(c.capacity for c in Classroom.query.filter_by(is_active=True).all())
physical_classrooms = [c for c in Classroom.query.filter_by(is_active=True).all() if not getattr(c, 'is_virtual', False) and (c.capacity or 0) < 999 and 'VIRTUAL' not in (c.code or '').upper()]
total_physical_capacity = sum(c.capacity for c in physical_classrooms)
total_capacity = total_physical_capacity
return render_template(
'buildings/list.html',
buildings=buildings,
total_classrooms=total_classrooms,
total_capacity=total_capacity,
total_physical_capacity=total_physical_capacity,
search=search,
status_filter=status_filter,
title='Building Management'