Skip to content

Commit

Permalink
add conditional slim_api for reserialization testing? or maybe unnece…
Browse files Browse the repository at this point in the history
…ssary?
  • Loading branch information
mochic committed Jul 12, 2024
1 parent 5a3d60e commit eca7767
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/aind_slims_api/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,16 @@ def fetch_attachments_content(self) -> \
class Attachment(SlimsBaseModel):

pk: int = Field(..., alias="attm_pk")
slims_api: Slims
slims_api: Optional[Slims] = None
_slims_table: SLIMSTABLES = "Attachment"

class Config:
arbitrary_types_allowed = True

def fetch_content(self) -> Response:
"""Fetches the content of this attachment"""
if not self.slims_api:
raise ValueError("Initialized without slims_api.")
return self.slims_api.get(f"repo/{self.pk}")

# attm_pk: SlimsColumn
Expand Down

0 comments on commit eca7767

Please sign in to comment.