错误(来自日志控制台):
File "D:\dev\gamerofprogrammer\guessbook\main.py", line 62
greeting = greetings_query.fetch(10)
IndentationError: unexpected indent
我的代码
class MainPage(webapp2.RequestHandler):
def get(self):
self.response.write('<html><body>')
guestbook_name = self.request.get('guestbook_name', DEFAULT_GUESTBOOK_NAME)
greetings_query = Greeting.query(ancestor=guestbook_key(guestbook_name)).order(Greeting.date)
greeting = greetings_query.fetch(10)
for greeting in greetings:
if greeting.author:
self.response.write('<b> </b> wrote: ' % greeting.author.nickname())
else:
self.response.write('An anonymous person wrote:')
self.response.write('<blockquote> %s </blockquote>' % cgi.escape(greeting.content))
if users.get_current_user():
url = users.create_logout_url(self.request.uri)
url_linktext = 'Logout'
else:
url = users.create_login_url(self.request.uri)
url_linktext = 'logout'
sign_query_params = urllib.urlencode({'guestbook_name': guestbook_name})
self.response.write(MAIN_PAGE_FOOTER_TEMPLATE % (sign_query_params, cgi.escape(GUESTBOOK_NAME), url, url_linktext))
所有这些代码都可以在Google App Engine中找到 我的缩进有什么问题?