Skip to content

Commit

Permalink
add back findspot needed for query_by_museum_number
Browse files Browse the repository at this point in the history
  • Loading branch information
fsimonjetz committed Nov 2, 2023
1 parent 22769e5 commit 7474d9d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ebl/fragmentarium/application/archaeology_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ class ArchaeologySchema(Schema):
DateWithNotesSchema, data_key="excavationDate", many=True, load_default=tuple()
)
findspot_id = fields.Integer(allow_none=True, default=None, data_key="findspotId")
findspot = fields.Nested(
FindspotSchema, allow_none=True, default=None, data_key="findspot"
)

@post_load
def create_archaeology(self, data, **kwargs) -> Archaeology:
Expand Down
2 changes: 2 additions & 0 deletions ebl/fragmentarium/domain/archaeology.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from ebl.fragmentarium.domain.iso_date import DateWithNotes
from ebl.transliteration.domain.museum_number import MuseumNumber as ExcavationNumber
from ebl.corpus.domain.provenance import Provenance as ExcavationSite
from ebl.fragmentarium.domain.findspot import Findspot


@attr.s(auto_attribs=True, frozen=True)
Expand All @@ -12,3 +13,4 @@ class Archaeology:
regular_excavation: bool = True
excavation_date: Sequence[DateWithNotes] = tuple()
findspot_id: Optional[int] = None
findspot: Optional[Findspot] = None
2 changes: 1 addition & 1 deletion ebl/fragmentarium/infrastructure/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def join_findspots() -> List[dict]:
{
"$lookup": {
"from": FINDSPOTS_COLLECTION,
"localField": "archaeology.findspot",
"localField": "archaeology.findspotId",
"foreignField": "_id",
"as": "findspots",
}
Expand Down

0 comments on commit 7474d9d

Please sign in to comment.