Thanks Alexander, I had to make some other changes but your code
helped mostly.

On Nov 10, 5:07 pm, Alexander Kojevnikov <[EMAIL PROTECTED]>
wrote:
> You write 'result.picture' but your property is called 'pic1'. Try
> this code:
>
> def get(self):
>     query_str = "SELECT * FROM Greeting ORDER BY date DESC"
>     result = GqlQuery(query_str).get()
>     self.response.headers['Content-Type'] = 'image/jpeg'
>     self.response.out.write(result.pic1)
>
> On Nov 11, 6:53 am, Toney <[EMAIL PROTECTED]> wrote:
>
> > I’m trying to display an image from the data store using the hello
> > world sample.  When I run the code below I get a blank image displayed
> > in FireFox.  I'm sure the image is uploaded because when I initially
> > tried {{ greeting.pic1|escape }} in the html file I got a bunch of
> > garbage back.
>
> > Can someone pls let me know what i'm doing wrong.
>
> > class Greeting(db.Model):
> >   author = db.UserProperty()
> >   date = db.DateTimeProperty(auto_now_add=True)
> >   pic1 = db.BlobProperty()
>
> > class GetImage(webapp.RequestHandler):
>
> >   def get(self):
>
> >     query_str = "SELECT * FROM Greeting ORDER BY date DESC LIMIT
> > 10"    result[0]
> >     self.response.headers['Content-Type'] = 'image/jpg'
> >     self.response.out.write(result.picture)
>
> > application = webapp.WSGIApplication(
> >                                      [('/upload/', MainPage),
> >                                      ('/upload/sign', Guestbook),
> >                                      ('/pic', GetImage)],
> >                                      debug=True)
>
> > ----------HTML-----------
> >  {% for greeting in greetings %}
>
> >  <img src="/pic?author={{greeting. author}}"></img>
>
> >     {% endfor %}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to