tgext asyncjob

29 views
Skip to first unread message

notnow

unread,
Jul 30, 2012, 4:29:22 PM7/30/12
to turbo...@googlegroups.com
Getting a message:

No object (name: app_globals) has been registered for this thread

app_globals.py is attached.

the error occurs with
asyncjob_perform(doinit, 0)

probably not significant but doinit is:
    def doinit(cntsys):
        RATIOs=DBSession.query(Ratio).filter_by(Year=ratioyear).one()
        val=DBSession.query(UnitCost).filter_by(Year=unityear).one()
        page= 'Total Salary Allocation'
        TheRow=[]
        sys2=DBSession.query(Sys).all()
        alltotinst=0
        countsys=0
        checkinit=[]
        countsys=DBSession.query(Sys).count()

        for row in sys2:
            #count =count+1
            cntsys=cntsys+1.39
            asyncjob_set_progress(cntsys, "")
            leano=row.id
            howtogot=howtoget(page,TheRow,leano,admyear,RATIOs, val,CDFyear)
            checkinit.append(howtogot)

I am following directions from here:
http://pypi.python.org/pypi/tgext.asyncjob/0.2.1

I have seen this ticket and tried unsuccessfully to make some modifications:
http://sourceforge.net/p/turbogears2/tickets/26/

Any suggestions?
app_globals.py

Alessandro Molina

unread,
Aug 6, 2012, 11:29:40 AM8/6/12
to turbo...@googlegroups.com
You should be able to pass the app_globals object as argument to the
asyncjob start_async_worker() call if it wasn't able to detect it by
itself.

Usually if placed inside the Globals __init__ method it should be able to.
> --
> You received this message because you are subscribed to the Google Groups
> "TurboGears" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/turbogears/-/8dx_x-1mbh8J.
> To post to this group, send email to turbo...@googlegroups.com.
> To unsubscribe from this group, send email to
> turbogears+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/turbogears?hl=en.
Reply all
Reply to author
Forward
0 new messages