Esempio n. 1
0
 def xform(self, request, *args, **kwargs):
     asset = self.get_object()
     export = asset._snapshot(regenerate=True)
     # TODO-- forward to AssetSnapshotViewset.xform
     response_data = copy.copy(export.details)
     options = {
         'linenos': True,
         'full': True,
     }
     if export.xml != '':
         response_data['highlighted_xform'] = highlight_xform(
             export.xml, **options)
     return Response(response_data, template_name='highlighted_xform.html')
Esempio n. 2
0
 def xform(self, request, *args, **kwargs):
     """
     This route will render the XForm into syntax-highlighted HTML.
     It is useful for debugging pyxform transformations
     """
     snapshot = self.get_object()
     response_data = copy.copy(snapshot.details)
     options = {
         'linenos': True,
         'full': True,
     }
     if snapshot.xml != '':
         response_data['highlighted_xform'] = highlight_xform(snapshot.xml,
                                                              **options)
     return Response(response_data, template_name='highlighted_xform.html')