Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6561677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:37:02+00:00 2026-05-25T13:37:02+00:00

I ‘m trying to retrieve data from a datastore by using this (in example)

  • 0

I ‘m trying to retrieve data from a datastore by using this
(in example)

class Book(db.Model):
title = db.StringProperty()
author = db.StringProperty()
category = db.StringProperty()

e = Book(title ="LOTR",
     author = "JRR Tolkien",
     category = "Adventure")

class Result(webapp.RequestHandler):

 Book = db.GqlQuery("SELECT * FROM Book")
    for book in Book:
        self.responce.out.write('<b>%s</b>' % book.title)

Which this solution is from a google example, but have this result

    Traceback (most recent call last):
  File "/home/kostas89/google_appengine/google/appengine/tools/dev_appserver.py", line 3858, in _HandleRequest
    self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
  File "/home/kostas89/google_appengine/google/appengine/tools/dev_appserver.py", line 3792, in _Dispatch
    base_env_dict=env_dict)
  File "/home/kostas89/google_appengine/google/appengine/tools/dev_appserver.py", line 580, in Dispatch
    base_env_dict=base_env_dict)
  File "/home/kostas89/google_appengine/google/appengine/tools/dev_appserver.py", line 2918, in Dispatch
    self._module_dict)
  File "/home/kostas89/google_appengine/google/appengine/tools/dev_appserver.py", line 2822, in ExecuteCGI
    reset_modules = exec_script(handler_path, cgi_path, hook)
  File "/home/kostas89/google_appengine/google/appengine/tools/dev_appserver.py", line 2697, in ExecuteOrImportScript
    handler_path, cgi_path, import_hook)
  File "/home/kostas89/google_appengine/google/appengine/tools/dev_appserver.py", line 2621, in LoadTargetModule
    module_code = compile(source_file.read(), cgi_path, 'exec')
  File "/home/kostas89/library/library.py", line 77
    for book in Book:
   ^
IndentationError: unexpected indent

I also tried the fetch() method without any result..

EDIT:
Yes but when i delete the indent, i have an error for the ‘self’.

Traceback (most recent call last):
  File "/home/kostas89/google_appengine/google/appengine/tools/dev_appserver.py", line 3858, in _HandleRequest
    self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
  File "/home/kostas89/google_appengine/google/appengine/tools/dev_appserver.py", line 3792, in _Dispatch
    base_env_dict=env_dict)
  File "/home/kostas89/google_appengine/google/appengine/tools/dev_appserver.py", line 580, in Dispatch
    base_env_dict=base_env_dict)
  File "/home/kostas89/google_appengine/google/appengine/tools/dev_appserver.py", line 2918, in Dispatch
    self._module_dict)
  File "/home/kostas89/google_appengine/google/appengine/tools/dev_appserver.py", line 2822, in ExecuteCGI
    reset_modules = exec_script(handler_path, cgi_path, hook)
  File "/home/kostas89/google_appengine/google/appengine/tools/dev_appserver.py", line 2702, in ExecuteOrImportScript
    exec module_code in script_module.__dict__
  File "/home/kostas89/library/library.py", line 74, in <module>
    class Result(webapp.RequestHandler):
  File "/home/kostas89/library/library.py", line 79, in Result
    self.responce.out.write('<b>%s</b>' % book.title)
NameError: name 'self' is not defined

I found that propably is because of the tabs/sapces and I try some solutions but still not working.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:37:03+00:00Added an answer on May 25, 2026 at 1:37 pm

    Look at the error that’s reported – it’s telling you the right thing:

    IndentationError: unexpected indent
    

    Remove the indentation, to produce:

     Book = db.GqlQuery("SELECT * FROM Book")
     for book in Book:
       self.responce.out.write('<b>%s</b>' % book.title)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Does anyone know how can I replace this 2 symbol below from the string
I am trying to create a RegEx expression that will successfully parse the following
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am currently running into a problem where an element is coming back from
I'm creating a web service to transfer json to an iPhone app. I'm using
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have a text area in my form which accepts all possible characters from
Hi if i run my project its indicate this logcat error...how to solve this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.