Files
plantillas-proyectos/backend/api/v1/modules/sitar/vehiculos_modelos/schemas.py
AlexeerCT 23509cbcc9 Refactor DTO classes to use model_config with ConfigDict for attribute handling
- Updated multiple DTO classes across various modules to replace the `Config` class with `model_config = ConfigDict(from_attributes=True)`.
- This change enhances consistency in attribute handling and aligns with the latest Pydantic practices.
- Adjusted error handling in core modules to change status codes from `HTTP_422_UNPROCESSABLE_ENTITY` to `HTTP_422_UNPROCESSABLE_CONTENT` for improved clarity in validation responses.
2026-03-24 12:06:55 -05:00

38 lines
1.5 KiB
Python

"""Vehiculos Modelos Schemas"""
from typing import Optional
from pydantic import BaseModel, ConfigDict, Field
class VehiculosModelosResponse(BaseModel):
"""Modelos de vehículos"""
FRACCION: Optional[str] = Field(None, max_length=8)
MARCA: Optional[str] = Field(None, max_length=60)
MODELO: Optional[str] = Field(None, max_length=80)
TIPO: Optional[str] = Field(None, max_length=1)
CLAVEUM: Optional[str] = Field(None, max_length=2)
A20: Optional[str] = Field(None, max_length=19)
A19: Optional[str] = Field(None, max_length=19)
A18: Optional[str] = Field(None, max_length=19)
A17: Optional[str] = Field(None, max_length=19)
A16: Optional[str] = Field(None, max_length=19)
A15: Optional[str] = Field(None, max_length=19)
A14: Optional[str] = Field(None, max_length=19)
A13: Optional[str] = Field(None, max_length=19)
A12: Optional[str] = Field(None, max_length=19)
A11: Optional[str] = Field(None, max_length=19)
A10: Optional[str] = Field(None, max_length=19)
A9: Optional[str] = Field(None, max_length=19)
A8: Optional[str] = Field(None, max_length=19)
A7: Optional[str] = Field(None, max_length=19)
A6: Optional[str] = Field(None, max_length=19)
A5: Optional[str] = Field(None, max_length=19)
A4: Optional[str] = Field(None, max_length=19)
A3: Optional[str] = Field(None, max_length=19)
A2: Optional[str] = Field(None, max_length=19)
A1: Optional[str] = Field(None, max_length=19)
SYSID: int
model_config = ConfigDict(from_attributes=True)