The logic for pulling an image out of the datastore is stored in the
image_sharing.py file....


class ImageSharingServeImage(webapp.RequestHandler):
  """Handler for dynamically serving an image from the datastore.

  Very simple - it just pulls the appropriate data out of the
datastore
  and serves it.
  """

  def get(self, display_type, pic_key):
    """Dynamically serves a PNG image from the datastore.

    Args:
      type: a string describing the type of image to serve (image or
thumbnail)
      pic_key: the key for a Picture model that holds the image
    """
    image = db.get(pic_key)

    if display_type == 'image':
      self.response.headers['Content-Type'] = 'image/png'
      self.response.out.write(image.data)
    elif display_type == 'thumbnail':
      self.response.headers['Content-Type'] = 'image/png'
      self.response.out.write(image.thumbnail_data)
    else:
      self.error(500)
      self.response.out.write(
          'Couldn\'t determine what type of image to serve.')



On Jun 23, 7:02 am, Jonathan Feinberg <e.e.c...@gmail.com> wrote:
> On Jun 23, 8:57 am, GenghisOne <mdkach...@gmail.com> wrote:
>
> > Here's a sample that might provide some value to you...
>
> >http://code.google.com/p/google-app-engine-samples/source/browse/trun...
>
> I couldn't find any reference to download_data there; which file
> defines the exporter?
--~--~---------~--~----~------------~-------~--~----~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to