|
@@ -165,33 +165,33 @@ class Home(View):
|
|
|
def post(self, request):
|
|
def post(self, request):
|
|
|
pass
|
|
pass
|
|
|
|
|
|
|
|
-# 外网首页2
|
|
|
|
|
-class Home2(View):
|
|
|
|
|
- def get(self, request):
|
|
|
|
|
- user_news = CKArticle.objects.filter(art_type=5)[0:10]
|
|
|
|
|
- zero_news = CKArticle.objects.filter(art_type=0)[0:10]
|
|
|
|
|
- one_news = CKArticle.objects.filter(art_type=1)[0:10]
|
|
|
|
|
- two_news = CKArticle.objects.filter(art_type=2)[0:10]
|
|
|
|
|
- video_news = Video_data.objects.all()[0:4]
|
|
|
|
|
- product = Product.objects.all()[0:8]
|
|
|
|
|
- pick = Pick_Pub.objects.all()[0:6]
|
|
|
|
|
- garden = GardenArea.objects.all()
|
|
|
|
|
- farm = FarmList.objects.all()
|
|
|
|
|
- hotel = Hotel_Info.objects.all()[0:5]
|
|
|
|
|
- article = CKArticle.objects.all()[0:12]
|
|
|
|
|
- if request.user.is_authenticated():
|
|
|
|
|
- user_name = request.user.username
|
|
|
|
|
- curr_user = MyUser.objects.get(username=user_name)
|
|
|
|
|
- print('user_name=', user_name)
|
|
|
|
|
- print('user=', curr_user.username)
|
|
|
|
|
- else:
|
|
|
|
|
- curr_user = ""
|
|
|
|
|
- return render(request, 'outerNet/index2.html', context={"user_news": user_news,"zero_news": zero_news, "one_news": one_news,"farm":farm,
|
|
|
|
|
- "two_news": two_news, "video_news": video_news,"hotel":hotel,"article":article,
|
|
|
|
|
- "product": product, "pick": pick, "garden": garden, "curr_user": curr_user})
|
|
|
|
|
-
|
|
|
|
|
- def post(self, request):
|
|
|
|
|
- pass
|
|
|
|
|
|
|
+# # 外网首页2-------------暂时不用
|
|
|
|
|
+# class Home2(View):
|
|
|
|
|
+# def get(self, request):
|
|
|
|
|
+# user_news = CKArticle.objects.filter(art_type=5)[0:10]
|
|
|
|
|
+# zero_news = CKArticle.objects.filter(art_type=0)[0:10]
|
|
|
|
|
+# one_news = CKArticle.objects.filter(art_type=1)[0:10]
|
|
|
|
|
+# two_news = CKArticle.objects.filter(art_type=2)[0:10]
|
|
|
|
|
+# video_news = Video_data.objects.all()[0:4]
|
|
|
|
|
+# product = Product.objects.all()[0:8]
|
|
|
|
|
+# pick = Pick_Pub.objects.all()[0:6]
|
|
|
|
|
+# garden = GardenArea.objects.all()
|
|
|
|
|
+# farm = FarmList.objects.all()
|
|
|
|
|
+# hotel = Hotel_Info.objects.all()[0:5]
|
|
|
|
|
+# article = CKArticle.objects.all()[0:12]
|
|
|
|
|
+# if request.user.is_authenticated():
|
|
|
|
|
+# user_name = request.user.username
|
|
|
|
|
+# curr_user = MyUser.objects.get(username=user_name)
|
|
|
|
|
+# print('user_name=', user_name)
|
|
|
|
|
+# print('user=', curr_user.username)
|
|
|
|
|
+# else:
|
|
|
|
|
+# curr_user = ""
|
|
|
|
|
+# return render(request, 'outerNet/index2.html', context={"user_news": user_news,"zero_news": zero_news, "one_news": one_news,"farm":farm,
|
|
|
|
|
+# "two_news": two_news, "video_news": video_news,"hotel":hotel,"article":article,
|
|
|
|
|
+# "product": product, "pick": pick, "garden": garden, "curr_user": curr_user})
|
|
|
|
|
+
|
|
|
|
|
+# def post(self, request):
|
|
|
|
|
+# pass
|
|
|
|
|
|
|
|
|
|
|
|
|
# 首页设备显示
|
|
# 首页设备显示
|