diff options
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/models.py | 16 | ||||
-rw-r--r-- | ishtar_common/models_common.py | 3 |
2 files changed, 9 insertions, 10 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 89bee27cd..bba04488b 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -196,7 +196,7 @@ class ValueGetter(object): val = '' elif (key in self.GET_VALUES_EXTRA_TYPES or "type" in key) and ( val.__class__.__name__.split('.')[0] == 'ManyRelatedManager'): - val = u" ; ".join([str(v) for v in val.all()]) + val = " ; ".join([str(v) for v in val.all()]) elif isinstance(val, (tuple, list, dict)): pass else: @@ -214,13 +214,6 @@ class ValueGetter(object): value_list.append((key, str(values[key]))) for global_var in GlobalVar.objects.all(): values[global_var.slug] = global_var.value or "" - if not filtr or 'VALUES' in filtr: - values['VALUES'] = json.dumps( - values, indent=4, sort_keys=True, - skipkeys=True, ensure_ascii=False, - separators=("", " : "), - ).replace(" " * 4, "\t") - return values @classmethod @@ -1459,7 +1452,14 @@ class DocumentTemplate(models.Model): ] ) """ + filtr = [] values = c_object.get_values() + if not filtr or 'VALUES' in filtr: + values['VALUES'] = json.dumps( + values, indent=4, sort_keys=True, + skipkeys=True, ensure_ascii=False, + separators=("", " : "), + ).replace(" " * 4, "\t") engine = IshtarSecretaryRenderer() try: result = engine.render(self.template, **values) diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py index 903d1d970..d2e118c7a 100644 --- a/ishtar_common/models_common.py +++ b/ishtar_common/models_common.py @@ -1745,8 +1745,7 @@ class Town(Imported, models.Model): 'year': self.year or ""} return values - def get_values(self, prefix='', no_values=False, filtr=None, - no_base_finds=True): + def get_values(self, prefix='', **kwargs): return { prefix or "label": str(self), prefix + "name": self.name, |