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 <noreply@anthropic.com>
This commit is contained in:
Danamir
2026-01-22 22:22:33 +01:00
parent e428e7f762
commit e2ff0f9a05
2 changed files with 5 additions and 4 deletions

View File

@@ -65,13 +65,13 @@ class OwnerRead(OwnerBase):
# === Oborud === # === Oborud ===
class OborudBase(BaseModel): class OborudBase(BaseModel):
invNumber: Optional[int] invNumber: Optional[int] = None
nazvanie: str nazvanie: str
raspologenie: Optional[str] = None raspologenie: Optional[str] = None
numberppasu: Optional[str] = None numberppasu: Optional[str] = None
kolichestvo: Optional[int] = None kolichestvo: Optional[int] = None
aud_id: int aud_id: Optional[int] = None
type_id: int type_id: Optional[int] = None
owner_id: Optional[int] = None owner_id: Optional[int] = None
class OborudCreate(OborudBase): class OborudCreate(OborudBase):
@@ -89,7 +89,7 @@ class OborudUpdate(BaseModel):
class OborudRead(OborudBase): class OborudRead(OborudBase):
id: int id: int
type: EquipmentTypeRead type: Optional[EquipmentTypeRead] = None
owner: Optional[OwnerRead] = None owner: Optional[OwnerRead] = None
components: List[ComponentRead] = [] components: List[ComponentRead] = []
consumables: List[ConsumableRead] = [] consumables: List[ConsumableRead] = []

View File

@@ -16,4 +16,5 @@ button:hover { border-color: var(--accent); }
table { width: 100%; border-collapse: collapse; } table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid #1f2937; padding: 8px; text-align: left; } th, td { border-bottom: 1px solid #1f2937; padding: 8px; text-align: left; }
th { color: var(--muted); font-weight: 600; } th { color: var(--muted); font-weight: 600; }
td.rasp { max-width: 200px; word-wrap: break-word; white-space: normal; }