def get(self,fid): delete_file=FileInfo.get_by_id(long(fid)) db.delete(delete_file) blobstore.delete([delete_file.blobkey]) # filelist=FileInfo.all() # filelist=filelist.filter('user =', users.get_current_user()) self.redirect("/list/")
def get(self,fid): matches=False if "iPhone" in self.request.headers["User-Agent"] or "Android" in self.request.headers["User-Agent"]: matches=True if matches: print "Mobile" mobile=True else: print "Desktop" mobile=False prefetchFilelist=apriori1.fileList filelist=FileInfo.all() filelist.filter('user ='******'User-Agent'] if fid: new_file=FileInfo.get_by_id(long(fid)) if not new_file: self.error(404) return self.render_template("upload.html",{'post_url':blobstore.create_upload_url('/uploaded'),'mobile':mobile,'new_file':new_file,'filelist':filelist,'ua':ua,'logout_url':users.create_logout_url('/'), }) else: self.render_template("upload.html",{'post_url':blobstore.create_upload_url('/uploaded'),'mobile':mobile,'filelist':filelist,'ua':ua,'logout_url':users.create_logout_url('/'), })
def get(self,fid): accessentry=Apriori(file_id=str(fid)) db.put(accessentry) file_info=FileInfo.get_by_id(long(fid)) if not file_info or not file_info.blobkey: self.error(404) return self.send_blob(file_info.blobkey,save_as=True)
def get(self,fid): filelist=FileInfo.all() filelist=filelist.filter('user ='******'new_file':new_file,'filelist':filelist,'logout_url':users.create_logout_url('/'), }) else: self.render_template("list.html",{'filelist':filelist,'logout_url':users.create_logout_url('/'), })
def get(self,fid): imagefile=FileInfo.get_by_id(long(fid)) image=Photo.all().filter('blobkey =',imagefile.blobkey.key()).get() self.render_template("thumbnail.html",{'image':image,'logout_url':users.create_logout_url('/'), })
def get(self,fid): file_info=FileInfo.get_by_id(long(fid)) if not file_info or not file_info.blobkey: self.error(404) return self.send_blob(file_info.blobkey,save_as=True)