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 | 855d7df00ff702b8191bbe6bb44a21124799228e (patch) | |
tree | 1e11e1946254e74e7c30140368c1736e3668c282 /ishtar_common/widgets.py | |
parent | 19239382e83f7c9a6d6991ea0b9198f291cdc277 (diff) | |
download | Ishtar-855d7df00ff702b8191bbe6bb44a21124799228e.tar.bz2 Ishtar-855d7df00ff702b8191bbe6bb44a21124799228e.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("-", "_"), |