Cleanest, fastest way to filter one element from the python list

Use generator comprehensions. If you want to find one and just one element or None use default argument in call for next, it won’t raise StopIteration if the item was not found in the list: first_or_default = next((x for x in lst if …), None)

Removing Models from Google App Engine at minimum cost

There come times when data schema changes so you’ll have to remove some models by the bunch. AFAIK there is no currently a „TRUNCATE TABLE MyKind” or „DROP TABLE MyKind” equivalent in Google App Engine data store, so you’ll have to write an ordinary request handler to do the bidding or use MapReduce. …

Back to Top