diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-12-17 11:38:49 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-12-12 12:20:59 +0100 |
commit | 9a933515d0a263a077b96cf2a0517f6e6b2be314 (patch) | |
tree | f1b5b051487152744002d1ca512507f56e54481f /ishtar_common/models_common.py | |
parent | 97e8942616164eb4df936f97307cbb5c2121d702 (diff) | |
download | Ishtar-9a933515d0a263a077b96cf2a0517f6e6b2be314.tar.bz2 Ishtar-9a933515d0a263a077b96cf2a0517f6e6b2be314.zip |
Find - Quick action n1 treatment: add redirect in table quick action - fix resulting_pk initialization (refs #5231)
Diffstat (limited to 'ishtar_common/models_common.py')
-rw-r--r-- | ishtar_common/models_common.py | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py index 0d8eeac54..83955ab73 100644 --- a/ishtar_common/models_common.py +++ b/ishtar_common/models_common.py @@ -2701,7 +2701,14 @@ class QuickAction: """ def __init__( - self, url, icon_class="", text="", target=None, rights=None, module=None + self, + url, + icon_class="", + text="", + target=None, + rights=None, + module=None, + is_popup=True, ): self.url = url self.icon_class = icon_class @@ -2709,6 +2716,7 @@ class QuickAction: self.rights = rights self.target = target self.module = module + self.is_popup = is_popup assert self.target in ("one", "many", None) def is_available(self, user, session=None, obj=None): @@ -3255,8 +3263,13 @@ class ShortMenuItem: class SerializeItem: SERIALIZE_EXCLUDE = ["search_vector"] - SERIALIZE_PROPERTIES = ["external_id", "multi_polygon_geojson", "point_2d_geojson", - "images_number", "json_sections"] + SERIALIZE_PROPERTIES = [ + "external_id", + "multi_polygon_geojson", + "point_2d_geojson", + "images_number", + "json_sections", + ] SERIALIZE_CALL = {} SERIALIZE_DATES = [] SERIALIZATION_FILES = [] @@ -3284,7 +3297,7 @@ class SerializeItem: and hasattr(value, "full_serialize") and not recursion ): - #print(field.name, self.__class__, self) + # print(field.name, self.__class__, self) value = value.full_serialize(recursion=True) elif field_name in self.SERIALIZATION_FILES: try: @@ -3305,7 +3318,7 @@ class SerializeItem: and hasattr(first_value, "full_serialize") and not recursion ): - #print(field.name, self.__class__, self) + # print(field.name, self.__class__, self) values = [ v.full_serialize(recursion=True) for v in values.all() ] @@ -3400,6 +3413,7 @@ class MainItem(ShortMenuItem, SerializeItem): mark_safe(action.text), mark_safe(action.rendered_icon), action.target or "", + action.is_popup, ] ) return qas |