예제 #1
0
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
예제 #2
0
def admin_video_delete(id):
    if logged_in(request):
        Video().delete(id)
        redirect('/admin/video')
예제 #3
0
def admin_video_edit(id):
    if logged_in(request):
        Video().update(request.POST)
        redirect('/admin/video')
예제 #4
0
def admin_video_edit_form(id):
    if logged_in(request):
        return template('admin/video/edit',
                        categories=Category().video_categories(),
                        video=Video().by_id(id))
예제 #5
0
def admin_video_new():
    if logged_in(request):
        Video().insert(request.POST)
        redirect('/admin/video')
예제 #6
0
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)