Commits

Markus Zapke-Gründemann committed 8709f6a

Prettified code.

Comments (0)

Files changed (2)

src/wankel/api/emitters.py

+from django.core.serializers.json import DateTimeAwareJSONEncoder
 from django.utils import simplejson
-from django.core.serializers.json import DateTimeAwareJSONEncoder
 
 from piston.emitters import Emitter
 
 class ExtJSONEmitter(Emitter):
     def render(self, request):
         callback = request.GET.get('callback')
-        ext_dict = {'success': True, 'data': self.construct(), 'message': 'Data found!'}
-        json = simplejson.dumps(ext_dict, cls=DateTimeAwareJSONEncoder, ensure_ascii=False, indent=4)
-
+        ext_dict = {'success': True, 'data': self.construct(),
+            'message': 'Data found!'}
+        json = simplejson.dumps(ext_dict, cls=DateTimeAwareJSONEncoder,
+            ensure_ascii=False, indent=4)
         # Callback
         if callback:
             return '%s(%s)' % (callback, json)
+        return json
 
-        return json
-    
 Emitter.register('ext-json', ExtJSONEmitter, 'application/json; charset=utf-8')

src/wankel/urls.py

 
 urlpatterns = patterns('',
     # Examples:
-    url(r'^$', direct_to_template, {
-        'template': 'index.html'
-    }),
+    url(r'^$', direct_to_template, {'template': 'index.html'}),
     # url(r'^wankel/', include('wankel.foo.urls')),
 
     # Uncomment the admin/doc line below to enable admin documentation: