A snippet of my code is attached.
In short, the scheduled action does fire, but any changes made during
its execution - either modifying the change request status or creating
the new PCMAccount table row - are not committed to the database. In
the log I see:
2008-02-01 16:26:04,335 fakepcm.controllers DEBUG DO ACTIVATE
u'0000000071'
2008-02-01 16:26:04,336 fakepcm.controllers DEBUG N
2008-02-01 16:26:04,337 fakepcm.controllers DEBUG D
2008-02-01 16:26:04,337 fakepcm.controllers DEBUG ... DONE
but later examination of the status column for the relevant entry
shows it to still have the value "N" and the other table row is not
created.
Richard
... in response to a web request ...
SD = datetime.datetime.strptime(SD, '%Y%m%d%H%M')
model.PCMChangeRequest(iccid=ICCID, msisdn=MSISDN,
tid=TID, status='N', statusdate=SD, timezone=TZ,
profile=PN)
scheduler._get_scheduler().schedule_task(
SingleShotTask(do_activate, TID), 10)
def do_activate(tid):
log.debug('DO ACTIVATE %r'%tid)
cr = list(model.PCMChangeRequest.selectBy(tid=tid))[0]
log.debug(cr.status)
model.PCMAccount(iccid=cr.iccid, msisdn=cr.msisdn, status='A',
statusdate=cr.statusdate, timezone=cr.timezone,
profile=cr.profile)
cr.status = 'D'
log.debug(cr.status)
log.debug('... DONE')
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---