diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-03-09 08:26:29 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-03-09 08:26:29 +0100 |
commit | 12770bc797d02e1f4d4ff8ed7f5ba1439d68e203 (patch) | |
tree | 8b0683ca5e113229e1ad6fd9404fc70a6fa8b3c2 /ishtar_common/views.py | |
parent | 44f4c82b62e4cffb342e62ae24531266c16f3860 (diff) | |
download | Ishtar-12770bc797d02e1f4d4ff8ed7f5ba1439d68e203.tar.bz2 Ishtar-12770bc797d02e1f4d4ff8ed7f5ba1439d68e203.zip |
Export: full path for urls
Diffstat (limited to 'ishtar_common/views.py')
-rw-r--r-- | ishtar_common/views.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ishtar_common/views.py b/ishtar_common/views.py index 6a03f1f60..18bdc6e36 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -996,12 +996,20 @@ def get_item(model, func_name, default_name, extra_request_keys=[], v = getattr(v, ky) if callable(v): v = v() + if hasattr(v, 'url'): + v = request.is_secure() and \ + 'https' or 'http' + '://' + \ + request.get_host() + v.url new_vals.append(v) elif val: try: val = getattr(val, ky) if callable(val): val = val() + if hasattr(val, 'url'): + val = request.is_secure() and \ + 'https' or 'http' + '://' + \ + request.get_host() + val.url new_vals.append(val) except AttributeError: # must be a query key such as "contains" |