From 75fbd9e615c7513f5a0e462f08430eda16b6d1ed Mon Sep 17 00:00:00 2001 From: liuzheng712 Date: Fri, 20 Nov 2015 11:08:39 +0800 Subject: [PATCH] annotation the Asset --- jumpserver/views.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/jumpserver/views.py b/jumpserver/views.py index 89bc75fd8..3f8ba2fae 100644 --- a/jumpserver/views.py +++ b/jumpserver/views.py @@ -80,18 +80,19 @@ def index_cu(request): # user = get_object(User, id=user_id) login_types = {'L': 'LDAP', 'M': 'MAP'} username = request.user.username - posts = Asset.object.all() - host_count = len(posts) - - new_posts = [] - post_five = [] - for post in posts: - if len(post_five) < 5: - post_five.append(post) - else: - new_posts.append(post_five) - post_five = [] - new_posts.append(post_five) + # TODO: need fix,liuzheng need Asset help + # posts = Asset.object.all() + # host_count = len(posts) + # + # new_posts = [] + # post_five = [] + # for post in posts: + # if len(post_five) < 5: + # post_five.append(post) + # else: + # new_posts.append(post_five) + # post_five = [] + # new_posts.append(post_five) return render_to_response('index_cu.html', locals(), context_instance=RequestContext(request))