|
@@ -27,7 +27,7 @@ import os
|
|
|
# from configure import verification_code
|
|
# from configure import verification_code
|
|
|
import re
|
|
import re
|
|
|
from apps.AppInfo.models import Equip, Equip_type, MyUser, QXZdata, QXZstatus, QXZdata_New, JKdata, Article, QXZstatus_New, QXZswitchdata, QXZswitchstatus, CKArticle, GardenManage, Video_data,\
|
|
from apps.AppInfo.models import Equip, Equip_type, MyUser, QXZdata, QXZstatus, QXZdata_New, JKdata, Article, QXZstatus_New, QXZswitchdata, QXZswitchstatus, CKArticle, GardenManage, Video_data,\
|
|
|
- Product, Pick_Pub, FarmList, Hotel_Info, GardenArea, Sightsee_Info,Hotel_Info
|
|
|
|
|
|
|
+Product, Pick_Pub, FarmList, Hotel_Info, GardenArea, Sightsee_Info,Hotel_Info, Relations
|
|
|
from qcloudsms_py import SmsSingleSender
|
|
from qcloudsms_py import SmsSingleSender
|
|
|
from qcloudsms_py.httpclient import HTTPError
|
|
from qcloudsms_py.httpclient import HTTPError
|
|
|
|
|
|
|
@@ -148,13 +148,14 @@ class Home(View):
|
|
|
two_news = CKArticle.objects.filter(art_type=2)[0:10]
|
|
two_news = CKArticle.objects.filter(art_type=2)[0:10]
|
|
|
video_news = Video_data.objects.all()[0:4]
|
|
video_news = Video_data.objects.all()[0:4]
|
|
|
product = Product.objects.all()[0:8]
|
|
product = Product.objects.all()[0:8]
|
|
|
- pick = Pick_Pub.objects.all()[0:6]
|
|
|
|
|
- farm = FarmList.objects.all()
|
|
|
|
|
|
|
+ pick = Pick_Pub.objects.all()[0:8]
|
|
|
|
|
+ farm = FarmList.objects.all()[0:8]
|
|
|
garden = GardenArea.objects.all()[0:6]
|
|
garden = GardenArea.objects.all()[0:6]
|
|
|
hotel = Hotel_Info.objects.all()[0:6]
|
|
hotel = Hotel_Info.objects.all()[0:6]
|
|
|
article = CKArticle.objects.all()[0:12]
|
|
article = CKArticle.objects.all()[0:12]
|
|
|
sightsee = Sightsee_Info.objects.all()[0:6]
|
|
sightsee = Sightsee_Info.objects.all()[0:6]
|
|
|
hotel2 = Hotel_Info.objects.all().order_by('-upl_time')[0:6]
|
|
hotel2 = Hotel_Info.objects.all().order_by('-upl_time')[0:6]
|
|
|
|
|
+ relation = Relations.objects.all()
|
|
|
if request.user.is_authenticated():
|
|
if request.user.is_authenticated():
|
|
|
user_name = request.user.username
|
|
user_name = request.user.username
|
|
|
curr_user = MyUser.objects.get(username=user_name)
|
|
curr_user = MyUser.objects.get(username=user_name)
|
|
@@ -162,7 +163,7 @@ class Home(View):
|
|
|
print('user=', curr_user.username)
|
|
print('user=', curr_user.username)
|
|
|
else:
|
|
else:
|
|
|
curr_user = ""
|
|
curr_user = ""
|
|
|
- return render(request, 'outerNet/index2.html', context={"user_news": user_news,"zero_news": zero_news, "one_news": one_news,"article":article,
|
|
|
|
|
|
|
+ return render(request, 'outerNet/index2.html', context={"user_news": user_news,"zero_news": zero_news, "one_news": one_news,"article":article,"relation":relation,
|
|
|
"two_news": two_news, "video_news": video_news,"hotel":hotel,"garden":garden,"hotel2":hotel2,
|
|
"two_news": two_news, "video_news": video_news,"hotel":hotel,"garden":garden,"hotel2":hotel2,
|
|
|
"product": product, "pick": pick, "farm": farm, "curr_user": curr_user,"sightsee":sightsee})
|
|
"product": product, "pick": pick, "farm": farm, "curr_user": curr_user,"sightsee":sightsee})
|
|
|
|
|
|