我收到的错误如下:
Traceback (most recent call last):
File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 511, in __call__
handler.get(*groups)
TypeError: get() takes exactly 1 argument (2 given)
什么是疯狂的我只有在部署应用程序后才能获得它 - 在开发服务器上,它运行得非常好。我正在撕扯我的头发!
import cgi
import os
import string
from google.appengine.api import users
from google.appengine.ext import webapp, db
from google.appengine.ext.webapp import util, template
from google.appengine.ext.webapp import template
from models import *
from functions import *
class ListView(webapp.RequestHandler):
def get(self, f):
url = users.create_logout_url(self.request.uri)
u = parse_url(f)
votergroup = Voter.all()
votergroup.filter('lists =', u['list'])
customlists = CustomList.all()
template_values = {
'votergroup': votergroup,
'customlists': customlists,
'url': url
}
path = os.path.join(os.path.dirname(__file__), 'templates/list_view.html')
self.response.out.write(template.render(path, template_values))
class CreateList(webapp.RequestHandler):
def get(self, f):
if users.is_current_user_admin():
cuser = None
else:
cuser = CampaignUser.all()
cuser.filter('uaccount =', users.get_current_user())
cuser = cuser[0]
u = parse_url(f)
c = db.get(u['group'])
filters = CustomGroupFilter.all()
filters.filter('customquery =', c.key())
l = CustomList()
l.name = 'Custom List: ' + c.name
l.campaign = cuser.campaign
l.put()
votergroup = Voter.all()
for filt in filters:
votergroup.filter(filt.queryfield + ' =', string.upper(filt.query))
for v in votergroup:
v.lists.append(str(l.key()))
v.put()
self.redirect('/list/target/custom/list/' + str(l.key()))
application = webapp.WSGIApplication(
[('/list/target/create/(.*)', CreateList),
('/list/(.*)', ListView)],
debug=True)
def main():
util.run_wsgi_app(application)
if __name__ == "__main__":
main()
答案 0 :(得分:0)
我弄清楚出了什么问题。我已经更改了应用程序的版本字符串 - 所以即使我正在更新它,它也是从旧的“版本”中提取的。将新的设置为默认值。