Add image upload functionality and enhance inventory template with image rendering
This commit is contained in:
parent
ca3417c269
commit
a2b035f522
8 changed files with 84 additions and 15 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue