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 929431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:10:14+00:00 2026-05-15T20:10:14+00:00

Hi I read a few post on this topic, lets say I want to

  • 0

Hi I read a few post on this topic, lets say I want to delete every object for a given class db.model such as LinkRating2, is there a way to delete it on startup with a simple command? I thought i remember seeing this somewhere eg –clear datastore?, otherwise I have been trying various methods in sdk console but all seem to be memory crashing as the file is taking forever just to load and start I don’t think there is any memory left about lol. So what would be best code method to delete entire entity?

class LinkRating2(db.Model):
    user = db.StringProperty()
    link = db.StringProperty()
    rating2 = db.FloatProperty()

tried this but this is super slow

results2 = LinkRating2.all()
results = results2.fetch(500)

while results:
    db.delete(results)
    results = results2.fetch(500)
  • 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-15T20:10:14+00:00Added an answer on May 15, 2026 at 8:10 pm

    is there a way to delete it on startup
    with a simple command? I thought i
    remember seeing this somewhere eg
    –clear datastore?

    If you’re talking about the development server, yes. dev_appserver.py --clear_datastore myapp will start you up with a fresh datastore. This is the best option when you’re working locally.

    I didn’t bother putting it in a while
    loop, as trying to delete all of the
    entities in one go probably stands a
    good chance of exceeding the 30-second
    deadline. You’ll just need to do this
    until all of the entities are gone.

    If you do want to wipe out every entity of a given type in production, this is a good excuse to use remote_api instead of writing a web-based handler, both to circumvent the 30 second deadline and to reduce the chance of your entitypocalypse code being run again by accident.

    One last thing: if you want to delete some entities but you don’t want to bother loading the model definition, you can use the low level datastore API:

    from google.appengine.api import datastore
    
    kind = 'LinkRating2'
    batch_size = 1000
    
    query = datastore.Query(kind=kind, keys_only=True)
    results = query.Get(batch_size)
    while results:
      print "Deleting %d %s entities" % (batch_size, kind)
      datastore.Delete(results)
      results = query.Get(batch_size)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I read at a few places (in the doc and in this blog post
In last few hours I've read a lot concerning this topic, and so far
I've read a few questions on SO (such as this one ) in regards
Apologies for the long post -- Read a few threads about this, but still
From what I've read, this topic has come up several times over the last
I know there's quite a few topics on this already, and I've read quite
EDIT2 Looks like I can't read properly, disregard this post, I will try to
I've read a few posts about backing up Subversion (on Windows) in particular this
I read a few websites and questions but all were far beyond my level
I read a few threads about the MainWindowHandle but i couldnt find a solution

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.