Ignore:
Timestamp:
17 Nov 2012, 22:43:58 (12 years ago)
Author:
uli
Message:

Try to rip out all UI-related stuff from w.k.reports. Put it into views.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/reports.py

    r9667 r9672  
    4848            self.context.delete_report_entry(entry)
    4949            self.flash('Report discarded: %s' % job_id)
    50         self.entries = self.context.get_report_jobs_description()
     50        self.entries = self._generate_entries(user_id=None)
     51        #self.entries = self.context.get_report_jobs_description()
    5152        if job_id and DOWNLOAD:
    5253            self.redirect(self._report_url(job_id))
    5354            return
    5455        return
     56
     57    def _generate_entries(self, user_id=None):
     58        entries = []
     59        for entry in self.context.get_running_report_jobs(user_id=user_id):
     60            job_id, gen_name, user = entry
     61            job = getUtility(IJobManager).get(job_id)
     62            descr = '%r, %r' % (job.args, job.kwargs)
     63            new_entry = (job_id, descr, job.status, job.finished, job.finished and not job.failed, not job.finished, job.begin_after, user)
     64            entries.append(new_entry)
     65        return entries
    5566
    5667
Note: See TracChangeset for help on using the changeset viewer.