Exemple #1
0
 def get_expert_user_list(self):
     qry = UserQuery(""" u.loginName, u.nickName,u.trueName """)
     qry.userTypeId = 3
     qry.userStatus = 0
     qry.metaSubjectId = self.get_current_subjectId()
     qry.metaGradeId = self.get_current_gradeId()
     expert_user_list = qry.query_map(10)
     request.setAttribute("expert_user_list", expert_user_list)
Exemple #2
0
 def get_upload_sorter(self):
     qry = UserQuery("""  u.resourceCount, u.loginName, u.nickName """)
     qry.metaSubjectId = self.subject.metaSubject.msubjId
     qry.metaGradeId = self.subject.metaGrade.gradeId
     qry.FuzzyMatch = True
     qry.orderType = 4  #UserQuery.ORDER_TYPE_RESOURCE_COUNT_DESC
     qry.userStatus = 0
     upload_sorter = qry.query_map(20)
     request.setAttribute("upload_sorter", upload_sorter)
Exemple #3
0
 def get_famous_user_list(self):
     qry = UserQuery(
         """  u.loginName, u.userIcon, u.loginName, u.nickName,u.trueName, subj.subjectId """
     )
     qry.userTypeId = 1
     qry.userStatus = 0
     qry.metaSubjectId = self.get_current_subjectId()
     qry.metaGradeId = self.get_current_gradeId()
     channel_user_list = qry.query_map(3)
     request.setAttribute("channel_user_list", channel_user_list)
Exemple #4
0
 def get_rcmd_blog_list(self):
     qry = UserQuery(
         """  u.loginName, u.userIcon, u.blogName,u.trueName, u.createDate, u.blogIntroduce  """
     )
     qry.userTypeId = 2
     qry.userStatus = 0
     qry.metaSubjectId = self.get_current_subjectId()
     qry.metaGradeId = self.get_current_gradeId()
     rcmd_blog_list = qry.query_map(3)
     request.setAttribute("rcmd_blog_list", rcmd_blog_list)
Exemple #5
0
 def get_hot_blog_list(self):
     qry = UserQuery(
         """  u.loginName, u.userIcon, u.blogName, u.trueName,u.createDate, u.blogIntroduce """
     )
     qry.userStatus = 0
     qry.orderType = UserQuery.ORDER_TYPE_VISITCOUNT_DESC
     qry.metaSubjectId = self.get_current_subjectId()
     qry.metaGradeId = self.get_current_gradeId()
     hot_blog_list = qry.query_map(3)
     request.setAttribute("hot_blog_list", hot_blog_list)
Exemple #6
0
 def get_new_blog_list(self):
     qry = UserQuery(
         """  u.loginName, u.userIcon, u.blogName, u.trueName,u.blogIntroduce, u.createDate """
     )
     qry.userStatus = 0
     #qry.setSubjectCondition(self.subject) 导航有改动
     qry.metaSubjectId = self.get_current_subjectId()
     qry.metaGradeId = self.get_current_gradeId()
     new_blog_list = qry.query_map(3)
     request.setAttribute("new_blog_list", new_blog_list)
Exemple #7
0
    def get_subject_comissioner(self):
        qry = UserQuery(
            """ u.loginName, u.nickName, u.userIcon, u.blogName,u.trueName, u.createDate, 
                        u.myArticleCount, u.otherArticleCount, u.resourceCount, u.blogIntroduce """
        )
        qry.metaSubjectId = self.get_current_subjectId()
        qry.bmd = 1
        qry.userStatus = 0
        qry.metaGradeId = self.get_current_gradeId()
        qry.isComissioner = True
        comissioner_list = qry.query_map(
            6)  # 按照界面 mengv1/subject/jiaoyanyuan.ftl 中获取 13 个.
        #print "comissioner_list = ", comissioner_list

        #hql = """select new Map(loginName, nickName, userIcon, blogName,trueName, createDate,articleCount, resourceCount, blogIntroduce)
        #         from User where subjectId = """+ str(self.get_current_subjectId()) +""" and gradeId = """ + str(self.get_current_gradeId()) + """
        #          and isComissioner=1 """
        #comissioner_list = Command(hql).open(6)
        #print "comissioner_list = ", comissioner_list
        request.setAttribute("comissioner_list", comissioner_list)