On Mon, Oct 17, 2011 at 3:50 AM, Sathvik Ponangi <psath...@gmail.com> wrote:

> db.files[0] = dict(hash=name, name=name, path=name)


may be you want to replace the above with:

db.files.insert(hash=name, name=name, path=name)

why are you assign it to db.files[0] ?

when you do db.table[index] you fetching rows by id, so db.files[1] will
return a row object filreting record with id == 1

textobj = db.files[1] will do the same as db(db.files.id==1).select()  is
there any record woth id == 1 ?

Do you know GAE sets the id's randomly, May be you need:

name = "TEST"

db.files.insert(hash=name, name=name, path=name)

textobj = db(db.files.id>0).select()
if textobj is None:

  print "Fail: 500 Internal Server Error"

Reply via email to