Skip to content

Instantly share code, notes, and snippets.

View mentat's full-sized avatar

Jesse Lovelace mentat

  • Austin, TX
View GitHub Profile
@mentat
mentat / views.py
Created October 27, 2011 22:50
Some helpful handlers for downloading blobs.
class BlobMigrationHandler(YourCustomHandler):
" List out the blob keys so we can migrate them. "
def get(self):
CHUNK = 300
cursor = self.request.GET.get('cursor')
q = blobstore.BlobInfo.all()
@mentat
mentat / jobs.py
Created October 27, 2011 22:47
Mapreduce job for blob migration
def migrate_blobstore(entity):
" Migrate entities with blob fields from another app. "
import urllib, mimetypes
from google.appengine.api import files
modified = False
fields = entity.get_blob_fields()
logging.debug("Fields are: %s" % fields)
for field in fields: