Skip to content

Instantly share code, notes, and snippets.

@csytan
csytan / dbextras.py
Created May 9, 2009 09:12
appengine db extras
from google.appengine.ext import db
from django.utils import simplejson
### Functions ###
def fetch_references(entities, attr):
"""Fetches and sets ReferenceProperty attributes in one db call"""
keys = []
for entity in entities:
key = getattr(entity, '_' + attr)
# Pickle with patch by Aaron Gallagher (habnabit) applied:
# http://bugs.python.org/issue3119
"""Create portable serialized representations of Python objects.
See module cPickle for a (much) faster implementation.
See module copy_reg for a mechanism for registering custom picklers.
See module pickletools source for extensive comments.
Classes: