diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-06-11 11:59:00 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-02-28 12:15:20 +0100 |
commit | 4ea9e96c0644b0986b1cf9d6b833f5bc3a175e94 (patch) | |
tree | 1e11e1946254e74e7c30140368c1736e3668c282 /ishtar_common/widgets.py | |
parent | ff317a39a65ccd2c919ece5f0923d04712f4a3c4 (diff) | |
download | Ishtar-4ea9e96c0644b0986b1cf9d6b833f5bc3a175e94.tar.bz2 Ishtar-4ea9e96c0644b0986b1cf9d6b833f5bc3a175e94.zip |
New container: parent container search dependency (refs #4936) - remove + button for parent (refs #4937)
Diffstat (limited to 'ishtar_common/widgets.py')
-rw-r--r-- | ishtar_common/widgets.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index df0d09764..9483f9719 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -645,11 +645,16 @@ class JQueryAutoComplete(forms.TextInput): source = "'" + str(self.source) + "'" except: raise ValueError('source type is not valid') - dynamic_limit = [ - 'id_' + lim.replace('_', '') + '-' + - '-'.join(field_id.split('-')[1:-1]) + '-' + lim - for lim in self.dynamic_limit - ] + dynamic_limit = [] + for lim in self.dynamic_limit: + field_ids = field_id.split('-') + if field_ids[1:-1]: + dynamic_limit.append( + 'id_' + lim.replace('_', '') + '-' + + '-'.join(field_ids[1:-1]) + '-' + lim) + else: + dynamic_limit.append('id_' + lim.replace('_', '')) + dct = {'source': mark_safe(source), 'field_id': field_id, 'safe_field_id': field_id.replace("-", "_"), |