how to send some data to the Thread module on python and google-map-engine

Posted by zjm1126 on Stack Overflow See other posts from Stack Overflow or by zjm1126
Published on 2010-04-21T07:56:04Z Indexed on 2010/04/21 8:13 UTC
Read the original article Hit count: 237

from google.appengine.ext import db
class Log(db.Model):
    content = db.StringProperty(multiline=True)

class MyThread(threading.Thread):
    def run(self,request):
        #logs_query = Log.all().order('-date')
        #logs = logs_query.fetch(3)
        log=Log()
        log.content=request.POST.get('content',None)
        log.put()

def Log(request):
    thr = MyThread()
    thr.start(request)
    return HttpResponse('')

error is :

Exception in thread Thread-1:
Traceback (most recent call last):
  File "D:\Python25\lib\threading.py", line 486, in __bootstrap_inner
    self.run()
  File "D:\zjm_code\helloworld\views.py", line 33, in run
    log.content=request.POST.get('content',None)
NameError: global name 'request' is not defined

© Stack Overflow or respective owner

Related posts about python

Related posts about google-app-engine