I don't use Python but... key ids are unique within entity groups so unless your entities are in entity groups you'd only have one with an id of 20.
On Wed, Aug 18, 2010 at 8:33 AM, TZ <zam...@googlemail.com> wrote: > Hi. > I want to recode my python webapplication script because it should run > on the Google App Engine. > Before I used SQL but now I must rewrite my database queries in GQL/ > Datastore by Google. > > I have problems to delete database entries. I want delete entries by > ID but it doesn't work. > > My db class: > > <code> > class board_topic_entry(db.Model): > title = db.StringProperty(required=True) > name = db.StringProperty(required=True) > message = db.TextProperty() > </code> > > The column "ID" is generated and filled with consecutive numbers > automatically. True? > > When I want delete a explicit database entry, I use this query: > > (for example) > > <code> > #... > q = db.GqlQuery("SELECT __key__ FROM board_topic_entry WHERE > ID=20") > results = q.fetch(10) > db.delete(results) > return 'deleted' > </code> > > It doesn't work! (But I get no error messages) When I do an operation > with an other database column such as: > > <code> > #... > q = db.GqlQuery("SELECT __key__ FROM board_topic_entry WHERE > title='test123'") > results = q.fetch(10) > db.delete(results) > return 'deleted' > </code> > > IT WORKS! > > Why? > How can I say: "Please delete the entry with the ID "X" ? > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to google-appeng...@googlegroups.com. > To unsubscribe from this group, send email to > google-appengine+unsubscr...@googlegroups.com<google-appengine%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > > -- -- Jeff -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.