Beispiel #1
0
def file(request, filename):
    mime = mimetypes.guess_type(filename)[0]
    file = VenueFile.gql("WHERE filename = :1", filename).fetch(1)
    response = HttpResponse(file[0].blob, mimetype=mime)
    response['Last-Modified'] = defaultdate.strftime("%a, %d %b %Y %H:%M:%S GMT")
    return response    
Beispiel #2
0
def get_venue_files(days, venue_key):
    files = VenueFile.gql("WHERE venue = :1 ORDER BY valid_until ASC",
                          venue_key).fetch(1000)
    return [file for file in files if check_validity(file, days[0], 'valid_until')]