diff options
Diffstat (limited to 'archaeological_warehouse/models.py')
-rw-r--r-- | archaeological_warehouse/models.py | 7 |
1 files changed, 7 insertions, 0 deletions
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): |