diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-05-23 11:53:33 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-05-23 11:53:33 +0200 |
commit | 6bf4bc8a63e1dcc754471081980103805cc02642 (patch) | |
tree | fd83a14d22ca2b084f850ab3b943dfdbd1c5da21 | |
parent | 6ae680af7ff8118341cf244b1b41e5e04644ba14 (diff) | |
download | Ishtar-6bf4bc8a63e1dcc754471081980103805cc02642.tar.bz2 Ishtar-6bf4bc8a63e1dcc754471081980103805cc02642.zip |
Document generation: manage types
-rw-r--r-- | ishtar_common/models.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 612b57b03..62ad1226d 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -57,6 +57,7 @@ from django.core.validators import validate_slug from django.db import connection from django.db.models import Q, Max, Count from django.db.models.signals import post_save, post_delete, m2m_changed +from django.db.models.fields.related import ManyToManyField, ManyToManyRel from django.db.utils import DatabaseError from django.template.defaultfilters import slugify from django.utils.functional import lazy @@ -149,6 +150,10 @@ class ValueGetter(object): val = values[key] if val is None: val = '' + elif "type" in key and ( + val.__class__.__name__.split('.')[0] + == 'ManyRelatedManager'): + val = [unicode(v) for v in val.all()] elif isinstance(val, (tuple, list, dict)): pass else: |