Created
January 26, 2013 20:09
-
-
Save gnunicorn/4644336 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from google.appengine.ext import db | |
import json | |
class AudioSummary(db.Model): | |
# keyname would a lower-case artist name. | |
audio_summary = db.TextProperty() | |
def prepolulate(artist, content): | |
if not isinstance(content, basestring): | |
content = json.dumps(content) | |
summary = AudioSummary(key_name=artist, audio_summary=content) | |
summary.put() | |
return summary | |
def get_audio_summary(artist): | |
return json.loads(AudioSummary.get_by_key_name(artist).audio_summary) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment