diff options
| -rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index fbae36c69c..3e8a66bfb1 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
| @@ -43,6 +43,7 @@ from django.utils.html import escape | |||
| 43 | from datetime import timedelta, datetime | 43 | from datetime import timedelta, datetime |
| 44 | from django.utils import formats | 44 | from django.utils import formats |
| 45 | from toastergui.templatetags.projecttags import json as jsonfilter | 45 | from toastergui.templatetags.projecttags import json as jsonfilter |
| 46 | from decimal import Decimal | ||
| 46 | import json | 47 | import json |
| 47 | from os.path import dirname | 48 | from os.path import dirname |
| 48 | from functools import wraps | 49 | from functools import wraps |
| @@ -145,6 +146,8 @@ def objtojson(obj): | |||
| 145 | return obj.total_seconds() | 146 | return obj.total_seconds() |
| 146 | elif isinstance(obj, QuerySet) or isinstance(obj, set): | 147 | elif isinstance(obj, QuerySet) or isinstance(obj, set): |
| 147 | return list(obj) | 148 | return list(obj) |
| 149 | elif isinstance(obj, Decimal): | ||
| 150 | return str(obj) | ||
| 148 | elif type(obj).__name__ == "RelatedManager": | 151 | elif type(obj).__name__ == "RelatedManager": |
| 149 | return [x.pk for x in obj.all()] | 152 | return [x.pk for x in obj.all()] |
| 150 | elif hasattr( obj, '__dict__') and isinstance(obj, Model): | 153 | elif hasattr( obj, '__dict__') and isinstance(obj, Model): |
