Changeset 9646


Ignore:
Timestamp:
16 Nov 2012, 12:27:15 (12 years ago)
Author:
Henrik Bettermann
Message:

We do not need an extra attribute for start time.

File:
1 edited

Legend:

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

    r9645 r9646  
    2323from zope import schema
    2424from zope.component import (
    25     getUtility, getUtilitiesFor, queryUtility, ComponentLookupError)
     25    getUtility, getUtilitiesFor, queryUtility)
    2626from zope.component.hooks import setSite
    2727from zope.interface import implementer
     
    105105        )
    106106
    107     starttime = schema.TextLine(
    108         title = u'Human readable start datetime')
    109 
    110107    def __init__(site, generator_name):
    111108        """Create a report job via generator."""
     
    181178            downloaded. This is only true if the job finished and
    182179            didn't raised exceptions.
    183 
    184         ``<starttime>``
    185             Datetime string indicating when the job was started.
    186180
    187181        If ``user_id`` is ``None``, all jobs are returned.
     
    298292    def __init__(self, site, generator_name, args=[], kw={}):
    299293        self._generator_name = generator_name
    300         try:
    301             tz = getUtility(IKofaUtils).tzinfo
    302             self.starttime = now(tz).strftime("%Y-%m-%d %H:%M:%S %Z")
    303         except ComponentLookupError:
    304             self.starttime = None
    305294        super(AsyncReportJob, self).__init__(
    306295            report_job, site, generator_name, args=args, kw=kw)
     
    486475            discardable = job.finished
    487476            downloadable = job.finished and not job.failed
    488             starttime = job.starttime
     477            starttime = getattr(job, 'begin_after', None)
     478            if starttime:
     479                starttime = starttime.astimezone(getUtility(IKofaUtils).tzinfo)
     480                starttime = starttime.strftime("%Y-%m-%d %H:%M:%S %Z")
    489481            if not hasattr(job, 'description'):
    490482                continue
Note: See TracChangeset for help on using the changeset viewer.