Usuario
Usuario extends Django’s AbstractUser and is the single user model for the entire SIGEP platform (AUTH_USER_MODEL = "principal.Usuario"). Every other model that references a user points to this model.
Authentication uses email as the unique identifier. The separate nombres, apellido_paterno, and apellido_materno fields replace reliance on AbstractUser’s first_name and last_name; those two fields are kept in sync automatically on every save() call so that get_full_name() and third-party integrations continue to work.
Fields
Inherited from
AbstractUser. Used as the login identifier alongside email.Unique email address. Used for authentication and account recovery. Stored as
EmailField(unique=True).Given name(s). Max 120 characters. Defaults to an empty string.
Paternal surname. Max 80 characters. Defaults to an empty string.
Maternal surname. Max 80 characters. Defaults to an empty string.
Optional phone number. Max 20 characters. Nullable.
Optional profile photo. Stored under
perfiles/. Accepts image files via ImageField.Operational role that controls module routing and permission gates. Indexed. Defaults to
PART. See the Rol choices table below.Timestamp updated automatically on every save (
auto_now=True).Rol choices
| Value | Display label | Description |
|---|---|---|
ADMIN | Administrador | Full platform administration access |
COOR | Coordinador | Event coordination and schedule management |
EVAL | Evaluador/Jurado | Rubric-based project evaluation |
PON | Ponente | Speaker submission and document upload |
PART | Participante | Project registration and certificate retrieval |
Methods and properties
Returns
nombres apellido_paterno apellido_materno, trimmed. Falls back to the inherited AbstractUser.get_full_name() and then to username if all name fields are blank.Property. Delegates to
get_full_name().Every time you save a
Usuario instance, first_name is set to nombres and last_name is set to apellido_paterno apellido_materno. Do not write to first_name or last_name directly — your changes will be overwritten.SolicitudRecuperacionCuenta
Tracks password-recovery requests. Each request generates a UUID token that is emailed to the user. The token expires at the time stored inexpira_en and can only be used once.
Fields
Primary key. Auto-generated UUID (
uuid4), not editable.The user who initiated the recovery request. Cascades on user deletion.
Unique, auto-generated UUID used in the recovery link. Not editable. Indexed.
Timestamp of request creation. Indexed. Defaults to
timezone.now.Timestamp of when the token was consumed. Nullable —
null means unused.Whether the token is still valid. Defaults to
True. Set to False by invalidar().IP address from which the recovery was requested. Nullable.
Browser or client identifier from the request. Max 255 characters. Nullable.
Absolute expiry timestamp. Required. Set by the view that creates the request.
Methods
Returns
True if timezone.now() >= expira_en. Use this to reject stale tokens without querying the database again.Sets
activo = False and stamps usado_en with the current time if it is not already set. Saves only the two changed fields via update_fields.