Example #1
0
 def run_from_ui(self, ar, **kw):
     #~ print 20130912
     #~ obj = ar.selected_rows[0]
     mf = TmpMediaFile(ar, self.target_file_format)
     settings.SITE.makedirs_if_missing(os.path.dirname(mf.name))
     self.appy_render(ar, mf.name)
     ar.set_response(success=True)
     ar.set_response(open_url=mf.get_url(ar.request))
Example #2
0
 def run_from_ui(self, ar, **kw):
     #~ print 20130912
     #~ obj = ar.selected_rows[0]
     mf = TmpMediaFile(ar, self.target_file_format)
     settings.SITE.makedirs_if_missing(os.path.dirname(mf.name))
     self.appy_render(ar, mf.name)
     ar.set_response(success=True)
     ar.set_response(open_url=mf.get_url(ar.request))
Example #3
0
    def run_from_ui(self, ar, **kw):
        # Prepare tmp file
        mf = TmpMediaFile(ar, 'xlsx')
        settings.SITE.makedirs_if_missing(os.path.dirname(mf.name))

        # Render
        self.render(ar, mf.name)

        # Tell client that the action was successful and that it
        # should open a new browser window on the generated file.
        ar.success(open_url=mf.get_url(ar.request))
Example #4
0
    def run_from_ui(self, ar, **kw):
        #~ print 20130912
        #~ obj = ar.selected_rows[0]
        mf = TmpMediaFile(ar, 'vcf')
        settings.SITE.makedirs_if_missing(os.path.dirname(mf.name))
        with open(mf.name, 'w') as wf:
            for obj in ar.selected_rows:
                j = vobject.vCard()
                obj.fill_vcard(j)
                wf.write(j.serialize())

        ar.set_response(success=True)
        ar.set_response(open_url=mf.get_url(ar.request))