|
@@ -422,7 +422,7 @@ class MediaView(MediaPath): |
|
|
def mediapath(self,name): |
|
|
def mediapath(self,name): |
|
|
return self.get_mediapath(self.media_table, self.linked_id, name) |
|
|
return self.get_mediapath(self.media_table, self.linked_id, name) |
|
|
|
|
|
|
|
|
@view_config(request_method='GET') #, http_cache = (EXPIRATION_TIME, {'public':True})) |
|
|
|
|
|
|
|
|
@view_config(request_method='GET', http_cache = (EXPIRATION_TIME, {'public':True})) |
|
|
def get(self): |
|
|
def get(self): |
|
|
name = self.request.matchdict.get('name') |
|
|
name = self.request.matchdict.get('name') |
|
|
try: |
|
|
try: |
|
@@ -431,10 +431,9 @@ class MediaView(MediaPath): |
|
|
self.request.response.content_type = test |
|
|
self.request.response.content_type = test |
|
|
except IOError: |
|
|
except IOError: |
|
|
pass |
|
|
pass |
|
|
#try: |
|
|
|
|
|
if 1: |
|
|
|
|
|
|
|
|
try: |
|
|
self.request.response.body_file = open( self.mediapath(name), 'rb', 10000) |
|
|
self.request.response.body_file = open( self.mediapath(name), 'rb', 10000) |
|
|
#except IOError: |
|
|
|
|
|
# raise NotFound |
|
|
|
|
|
|
|
|
except IOError: |
|
|
|
|
|
raise NotFound |
|
|
return self.request.response |
|
|
return self.request.response |
|
|
##return Response(app_iter=ImgHandle, content_type = 'image/png') |
|
|
##return Response(app_iter=ImgHandle, content_type = 'image/png') |