Hi All,

I am new to python - so this might be embarrassing - but thanks in
advance!

Can somebody tell me why I get an error when I uncomment the line in
the code below and run it in the appengine interactive shell?

The error I get is:

'title =', 'song'
Traceback (most recent call last):
  File "/Users/srini/Desktop/iFaceApps/SVN/unfuddle/iChannel/App
Engine/App Engine/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/ext/admin/__init__.py", line 208, in post
    exec(compiled_code, globals())
  File "<string>", line 22, in <module>
TypeError: filter() takes exactly 3 arguments (2 given)


------code begins--------

class Song(db.Model):
  title = db.StringProperty()
  composer = db.StringProperty()

song = Song()

song.title = "song"
song.composer = "me"
song.put()

query = db.Query(Song)

attr = 'title'
value = 'song'

query_string = '\'' + attr + ' =' + '\', ' + '\'' + value + '\''

print query_string
query = Song.all()

query.filter('title =', "song") # no error!
#query.filter(query_string)    #error!
result = query.fetch(1000)

print result[0]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to