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:
@@ -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] = []
|
||||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user