Changes between Version 8 and Version 9 of Version2/Tutoriales/Consola_Web/Tutorial_4_Jobs


Ignore:
Timestamp:
Mar 29, 2011, 10:21:58 PM (9 years ago)
Author:
edulix
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Version2/Tutoriales/Consola_Web/Tutorial_4_Jobs

    v8 v9  
    3636    def enable(self):
    3737        self.actions_for_url = ('navigator/computer/(.*)', 'get_uptime')
    38         self.urls = ('action/get_uptime/computer/(.*)', UptimeView)
     38        self.urls = ('self.get_action_url('get_uptime')', UptimeView)
    3939}}}
    4040
     
    5959            if job.last_modified_date + datetime.timedelta(minutes = 2) > datetime.datetime.now():
    6060                # New job needed
    61                 job = GetUptimeJob(web.ctx.orm)
    62                 job.send(computer.id)
     61                job = GetUptimeJob()
     62                job.send(computer)
    6363                web.ctx.header("Refresh", "2; url=%s", web.ctx.fullpath)
    6464                return web.ctx.render.plugins.uptime.view()
     
    6868        if job.status 'ERROR':
    6969            # New job needed, previous one gave an error
    70             job = GetUptimeJob(web.ctx.orm)
    71             job.send(computer.id)
     70            job = GetUptimeJob()
     71            job.send(computer)
    7272        web.ctx.header("Refresh", "2; url=%s", web.ctx.fullpath)
    7373        return web.ctx.render.plugins.uptime.view()