def delete(request): torrent = request.form.get('torrent') db.Torrent.get(info_hash=torrent).delete() mc.delete('torrent_overview') return { 'success': True }
def upload(request): torrent = request.files.get('torrent') category = request.form.get('category') username = request.form.get('username') new_torrent = db.Torrent(torrent) new_torrent.category = category new_torrent.uploaded_by = username new_torrent.store() mc.delete('torrent_overview') return { 'success': True }