Add image upload functionality and enhance inventory template with image rendering

This commit is contained in:
Yaro Kasear 2025-07-11 11:48:53 -05:00
parent ca3417c269
commit a2b035f522
8 changed files with 84 additions and 15 deletions

View file

@ -1,4 +1,6 @@
from typing import Any, List, Optional, TYPE_CHECKING
from inventory.models.photo import Photo
if TYPE_CHECKING:
from .brands import Brand
from .items import Item
@ -125,3 +127,6 @@ class Inventory(db.Model, PhotoAttachable):
barcode=data.get("barcode"),
shared=bool(data.get("shared", False))
)
def attach_photo(self, photo: Photo) -> None:
self.photo = photo