From c641fca2bc2bd5c6892b4105325dee99e9da35d6 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 18 May 2022 16:24:26 +0200 Subject: Syndication - serialization - display sheet find - 2 --- archaeological_warehouse/models.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'archaeological_warehouse/models.py') diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index 2ea825406..8494b5bdc 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -1016,6 +1016,10 @@ class Container( QUICK_ACTIONS = [QA_EDIT, QA_LOCK] BASE_QUERY_LOCATION = "container_tree_child__container_parent" + SERIALIZE_CALL = { + "localisation_list": "localisation_list", + } + SERIALIZE_PROPERTIES = MainItem.SERIALIZE_PROPERTIES + ["short_label"] objects = UUIDModelManager() @@ -1430,6 +1434,9 @@ class Container( localisations.append(self.location) return reversed(localisations) + def localisation_list(self): + return [l.short_label for l in self.get_localisations()] + def get_localisation(self, place): locas = list(self.get_localisations()) if len(locas) < (place + 1): -- cgit v1.2.3