Beispiel #1
0
 def get(self, request, *args, **kwargs):
     context = {}
     context["topnav"] = 6
     pageindex,pagesize = Util.InitPagenation(request)
     #育儿宝典
     context["educationlist"] = EducationCare.objects.filter().order_by("-createtime")[(pageindex - 1) * pagesize:pagesize * pageindex]
     counts = EducationCare.objects.filter().count()
     context["pagenationHtml"] = Util.GetPagenation(request,counts,pagesize)
     return render_to_response("web-education.html", context, context_instance=RequestContext(request))
Beispiel #2
0
 def get(self, request, *args, **kwargs):
     context = {}
     context["topnav"] = 2
     pageindex,pagesize = Util.InitPagenation(request)
     #新闻
     newslist = NewsInfo.objects.filter().order_by("-createtime")[(pageindex - 1) * pagesize:pagesize * pageindex]
     if newslist:
         newslist_new = []
         for news in newslist:
             news.createtime = Util.timeFormat(news.createtime,True)
             newslist_new.append(news)
         context["newslist"] = newslist_new
     counts = NewsInfo.objects.filter().count()
     context["pagenationHtml"] = Util.GetPagenation(request,counts,pagesize)
     return render_to_response("web-news.html", context, context_instance=RequestContext(request))
Beispiel #3
0
 def get(self, request, *args, **kwargs):
     context = {}
     context["topnav"] = 5
     pageindex,pagesize = Util.InitPagenation(request)
     #课程
     courselist = CourseInfo.objects.filter().order_by("-createtime")[(pageindex - 1) * pagesize:pagesize * pageindex]
     counts = CourseInfo.objects.filter().count()
     if courselist:
         courselist_new = []
         for course in courselist:
             if course.imagepath:
                 course.imagepath = Util.getFileUrl(course.imagepath)
             else:
                 course.imagepath = "/static/img/banner/noimg_course.png"
             courselist_new.append(course)
     context["courselist"] = courselist
     context["pagenationHtml"] = Util.GetPagenation(request,counts,pagesize)
     return render_to_response("web-course.html", context, context_instance=RequestContext(request))
Beispiel #4
0
 def get(self, request, *args, **kwargs):
     context = {}
     context["topnav"] = 3
     pageindex,pagesize = Util.InitPagenation(request)
     #活动
     activitylist = ActivityInfo.objects.filter().order_by("-createtime")[(pageindex - 1) * pagesize:pagesize * pageindex]
     counts = ActivityInfo.objects.filter().count()
     if activitylist:
         activitylist_new = []
         for activity in activitylist:
             if activity.activeImage:
                 activity.Image = Util.getFileUrl(activity.activeImage)
             else:
                 activity.Image = "/static/img/banner/noimg_active.png"
             activitylist_new.append(activity)
     context["activitylist"] = activitylist
     context["pagenationHtml"] = Util.GetPagenation(request,counts,pagesize)
     return render_to_response("web-activity.html", context, context_instance=RequestContext(request))