import cgi
import datetime
import logging
from google.appengine.ext import db
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.api import images
class Photo(db.Model):
author = db.UserProperty()
content = db.StringProperty(multiline=True)
imgBlob = db.BlobProperty()
date = db.DateTimeProperty(auto_now_add=True)
query_str = "SELECT * FROM Photo ORDER BY date DESC LIMIT 10"
photos = db.GqlQuery(query_str)
for photo in photos:
print photo.author.email()
print photo.content
photo.imgBlob=db.Blob(open("./img/go.jpg").read())
photo.put()