def admin_video_sort(json_string): id_list = json.loads(urllib.unquote(json_string)) i = 1 for id in id_list: print id, i Video().update_position(id, i) i = i + 1
def admin_video_delete(id): if logged_in(request): Video().delete(id) redirect('/admin/video')
def admin_video_edit(id): if logged_in(request): Video().update(request.POST) redirect('/admin/video')
def admin_video_edit_form(id): if logged_in(request): return template('admin/video/edit', categories=Category().video_categories(), video=Video().by_id(id))
def admin_video_new(): if logged_in(request): Video().insert(request.POST) redirect('/admin/video')
def admin_video_category(id): if logged_in(request): return template('admin/video/all', videos=Video().by_category(id), categories=Category().video_categories(), sortable=True)