Django-ListView

  Python
  1. ListView中的排序
    Django ListView在定义时支持排序的
    如下:
class IndexView(ListView):
    model = web_status
    ordering = '-status' #排序
    template_name = 'WebMonitor/index.html'
    context_object_name = 'data_list'
    paginate_by = 20