From e2ff0f9a05a5045eef18e3281cc9c849880c70ea Mon Sep 17 00:00:00 2001 From: Danamir Date: Thu, 22 Jan 2026 22:22:33 +0100 Subject: [PATCH] fix: make optional fields nullable in schema, add text wrap for location field - Make type_id, aud_id, invNumber optional in OborudBase schema - Make type optional in OborudRead to support NULL values after migration - Add CSS word-wrap for raspologenie column to prevent text overflow Co-Authored-By: Claude Opus 4.5 --- backend/schemas.py | 8 ++++---- frontend/styles.css | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/schemas.py b/backend/schemas.py index c3fdc7c..147705d 100644 --- a/backend/schemas.py +++ b/backend/schemas.py @@ -65,13 +65,13 @@ class OwnerRead(OwnerBase): # === Oborud === class OborudBase(BaseModel): - invNumber: Optional[int] + invNumber: Optional[int] = None nazvanie: str raspologenie: Optional[str] = None numberppasu: Optional[str] = None kolichestvo: Optional[int] = None - aud_id: int - type_id: int + aud_id: Optional[int] = None + type_id: Optional[int] = None owner_id: Optional[int] = None class OborudCreate(OborudBase): @@ -89,7 +89,7 @@ class OborudUpdate(BaseModel): class OborudRead(OborudBase): id: int - type: EquipmentTypeRead + type: Optional[EquipmentTypeRead] = None owner: Optional[OwnerRead] = None components: List[ComponentRead] = [] consumables: List[ConsumableRead] = [] diff --git a/frontend/styles.css b/frontend/styles.css index f24719b..9e21618 100644 --- a/frontend/styles.css +++ b/frontend/styles.css @@ -16,4 +16,5 @@ button:hover { border-color: var(--accent); } table { width: 100%; border-collapse: collapse; } th, td { border-bottom: 1px solid #1f2937; padding: 8px; text-align: left; } th { color: var(--muted); font-weight: 600; } +td.rasp { max-width: 200px; word-wrap: break-word; white-space: normal; }