How ivansosabz/legajos-de-funcionarios works
1. Purpose and Runtime
This is a server-rendered Django system for managing public-employee personnel files (“legajos”): employee records, associated documents, evaluations, and labor events. It runs on Python/Django through the development entry point manage.py; deployment adapters are legajosdefuncionarios/wsgi.py and legajosdefuncionarios/asgi.py.
2. Project Composition and Routing
The Django project package centralizes settings and top-level URL composition:
• legajosdefuncionarios/settings.py
• legajosdefuncionarios/urls.py
• legajosdefuncionarios/views.py
Feature apps expose their own URL/view boundaries, then render HTML templates rather than providing a separate API. Request flow is: browser → project/app URL routing → view → form/model persistence → template response.
3. Employee Records as the Core Domain
funcionarios is the central personnel-record app and likely the parent entity for the other business domains. It owns employee persistence, input validation, CRUD request handling, and views/templates:
• funcionarios/models.py
• funcionarios/forms.py
• funcionarios/views.py
Its schema originates in funcionarios/migrations/0001_initial.py. Other modules’ migration names explicitly reference funcionario, indicating that evaluations, documents, and events are associated with an employee record.
4. Personnel File Documents
documentos manages digitized documents connected to personnel files, including a separate document-type management area. The app has model/form/view layers and templates for document CRUD and type CRUD:
• documentos/models.py
• documentos/views.py
• templates/documentos/tipos/index.html
Document state evolved through documentos/migrations/0002_alter_documentofuncionario_estado.py, making document status a meaningful lifecycle boundary. Storage implementation is not evident from the supplied tree; do not assume local media, object storage, or external document services.
5. Evaluations and Employment Events
Two independent employee-associated domains capture time-based HR history:
• Performance/employee evaluations: evaluaciones/models.py, evaluaciones/forms.py, evaluaciones/views.py
• Labor events: eventoslaborales/models.py, eventoslaborales/forms.py, eventoslaborales/views.py
Both follow server-side CRUD flows with list/create/edit/delete templates. Event migrations show employee linkage and end-date handling are part of the modeled lifecycle: eventoslaborales/migrations/0002_rename_funcionario_eventolaboral_id_funcionario_and_more.py and eventoslaborales/migrations/0003_alter_eventolaboral_fecha_fin.py.
6. Identity and Access Boundary
usuarios isolates user/account concerns from personnel records:
• usuarios/models.py
• usuarios/forms.py
• usuarios/views.py
It has its own routing and a login template at templates/usuarios/login.html. The README claims role-based access control, but the available tree alone does not establish the exact authorization model, permissions, or whether Django’s built-in auth is extended.
7. Persistence, UI, and External Dependencies
Django migrations are the database contract across each domain app; development uses SQLite and production is intended to use PostgreSQL per README. Dependencies are declared in requirements.txt. The presentation layer is Django templates organized by app, composed through templates/layouts/base.html, with static CSS/JavaScript under static/. Bootstrap 5 is the stated UI framework. No queue, cache, API gateway, cloud provider, or third-party SaaS integration is evidenced in the repository tree.
Main entry points: urls.py Project settings & routes · funcionarios/models.py Employee records · base.html App templates · evaluaciones/models.py Employee evaluations
Components 17
Django Runtime
- Django entry point
manage.py - Project settings & routes
legajosdefuncionarios/urls.py - WSGI / ASGI adapters
legajosdefuncionarios/wsgi.py - Migration contracts · Per-app schema history defines the database contract.
funcionarios/migrations/0001_initial.py - Relational database · Development uses SQLite; production is intended for PostgreSQL.
- Dependencies
requirements.txt
Personnel Domains
- User accounts · Login and account concerns are isolated from personnel records.
usuarios/views.py - Employee records · Parent personnel-file entity for associated HR domains.
funcionarios/models.py - Employee validation
funcionarios/forms.py - Personnel documents · Manages digitized documents, types, and document status.
documentos/models.py - Employee evaluations
evaluaciones/models.py - Evaluation validation
evaluaciones/forms.py - Labor events · Captures employee-linked events with end-date lifecycle handling.
eventoslaborales/models.py - Event validation
eventoslaborales/forms.py
Server-rendered UI
- App templates · CRUD and login pages are rendered server-side.
templates/layouts/base.html - Static assets · Bootstrap-based presentation assets.
Other components
- Browser
Connections 26
- Browser → Project settings & routes: HTTP requests
- Django entry point → Project settings & routes: starts Django
- WSGI / ASGI adapters → Project settings & routes: serves application
- Project settings & routes → User accounts: routes requests
- Project settings & routes → Employee records: routes requests
- Project settings & routes → Personnel documents: routes requests
- Project settings & routes → Employee evaluations: routes requests
- Project settings & routes → Labor events: routes requests
- User accounts → App templates: renders login
- Employee records → Employee validation: validates CRUD input
- Employee records → Relational database: persists employees
- Personnel documents → Employee records: belongs to employee
- Personnel documents → Relational database: persists document metadata
- Employee evaluations → Employee records: belongs to employee
- Employee evaluations → Evaluation validation: validates CRUD input
- Employee evaluations → Relational database: persists evaluations
- Labor events → Employee records: belongs to employee
- Labor events → Event validation: validates CRUD input
- Labor events → Relational database: persists events
- Migration contracts → Relational database: evolves schema
- Employee records → App templates: renders CRUD pages
- Personnel documents → App templates: renders CRUD pages
- Employee evaluations → App templates: renders CRUD pages
- Labor events → App templates: renders CRUD pages
- App templates → Static assets: uses UI assets
- Dependencies → Django entry point: provides Django dependencies