@require_role('admin')
def idc_list(request):
 (header_title, path1, path2) = (u'\u67e5\u770bIDC', u'\u8d44\u4ea7\u7ba1\u7406', u'\u67e5\u770bIDC')
 posts = IDC.objects.all()
 keyword = request.GET.get('keyword', '')
 if keyword:
  posts = IDC.objects.filter((Q(name__contains=keyword) | Q(comment__contains=keyword)))
 else:
  posts = IDC.objects.exclude(name='ALL').order_by('id')
 (contact_list, p, contacts, page_range, current_page, show_first, show_end) = pages(posts, request)
 return my_render('jasset/idc_list.html', locals(), request)

@ require_role ( 'admin' ) def idc_list ( request ) : ( header_title , path1 , path2 ) = ( u'\u67e5\u770bIDC' , u'\u8d44\u4ea7\u7ba1\u7406' , u'\u67e5\u770bIDC' ) posts = IDC . objects . all ( ) keyword = request . GET . get ( 'keyword' , '' ) if keyword : posts = IDC . objects . filter ( ( Q ( name__contains = keyword ) | Q ( comment__contains = keyword ) ) ) else : posts = IDC . objects . exclude ( name = 'ALL' ) . order_by ( 'id' ) ( contact_list , p , contacts , page_range , current_page , show_first , show_end ) = pages ( posts , request ) return my_render ( 'jasset/idc_list.html' , locals ( ) , request )
idc list view .