Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

47 lines (39 sloc) 1.246 kB
import logging
from google.appengine.ext import db
class Greeting(db.Model):
uid = db.StringProperty()
content = db.StringProperty(multiline=True)
date = db.DateTimeProperty(auto_now_add=True)
_facebook = None
_author = None
def fbinit(self, facebook):
self._facebook = facebook
self._author = None
logging.debug("Greeting: Facebook initialized")
def author(self):
if self._author:
logging.debug("Greeting: Author returned")
return self._author
elif self._facebook:
logging.debug("Greeting: Author will be loaded")
self._author = Author(self.uid, self._facebook)
return self._author
logging.debug("Greeting: Neither facebook nor author were init'd")
return None
class Author(object):
def __init__(self, uid="", facebook=None):
self.uid = uid
if facebook:
elif uid == "": = "Test User"
self.pic_small = ''
self.pic_square = ''
def load(self, facebook):
data = facebook.users.getInfo(
['uid', 'name', 'pic_small', 'pic_square'])[0] = data['name']
self.pic_small = data['pic_small']
self.pic_square = data['pic_square']
Jump to Line
Something went wrong with that request. Please try again.