Getting BadValueError on Google App Engine Datastore Delete
I am trying to delete records in the datastore. Unfortunately, whenever I try to delete the items, it gives me a BadValueError, saying Districts (one of the columns) is required. Because of an issue with the bulk loader, Districts is null for all of the rows...but I still need to clean out the datast开发者_如何转开发ore to try to fix the bulk loader error.
What can I do?
Try updating your model so that the Districts
field is not required (i.e., pass required=False
as a keyword parameter to the Districts
field). Then the validator shouldn't complain about the existing entities and you should be able to delete the entities.
Alternatively, if you know the keys for the entities you want to delete, you can delete them directly using db.delete()
without ever needing to fetch them in the first place.
You might even be able to use the datastore viewer from the Dashboard to delete them (if you don't have many entities to delete, this might be easiest).
Change your entities/models so that Districts
is no longer a required property?
精彩评论