translate most modules to using print() as imported from __future__
[unfold.git] / rest / create.py
index afb62b7..25d1a6e 100644 (file)
@@ -1,3 +1,5 @@
+from __future__ import print_function
+
 from django.views.generic.base      import TemplateView
 from django.shortcuts               import render_to_response
 
@@ -23,8 +25,8 @@ def dispatch(request, object_type, object_name):
     elif request.method == 'GET':
         #return error('only post request is supported')
         req_items = request.GET
-    print req_items
-    for el in req_items.items():
+    print(req_items)
+    for el in list(req_items.items()):
         # Filters not used for create
         if el[0].startswith('filters'):
             o.filters[el[0][8:-1]] = el[1]
@@ -44,6 +46,6 @@ def dispatch(request, object_type, object_name):
         else :
             return error('an error has occurred')
  
-    except Exception, e:
+    except Exception as e:
         return error(str(e))