def get(self): ''' GET verb call Returns: JSON/HTML/PDF view of the data. ''' name = database.view("file/admin").all() for i in range(len(name)): name[i] = name[i]['value'] totals = {'data': name} total = dict(totals) view = totalView(data=total) return view.returnData()
def delete(self): ''' DELETE verb call Goes through and tells the database to delete the given document And returns the data with value 'delete' as true Returns: JSON/HTML/PDF view of the dat ''' fileID = int(self.hasMember('file')) name = database.view("file/admin", key=fileID).first()['value'] name['delete'] = True a = name['_id'] database.delete_doc(a) fileData = dict(name) view = fileView(data=fileData) return view.returnData()