Quellcode durchsuchen

测报灯图片收集

yf_ymm vor 5 Jahren
Ursprung
Commit
cd2afcfe81
3 geänderte Dateien mit 5 neuen und 2 gelöschten Zeilen
  1. 1 1
      apps/AppInfo/admin.py
  2. 1 0
      apps/AppInfo/models.py
  3. 3 1
      apps/Equipment/views.py

+ 1 - 1
apps/AppInfo/admin.py

@@ -562,7 +562,7 @@ class GardenManageAdmin(admin.ModelAdmin):
 @admin.register(GardenArea)
 class GardenAreaAdmin(admin.ModelAdmin):
     # 列表页面显示字段
-    list_display = ['name','user','garden','manage','location','addr','area','mobile','img','img_1','desc','upl_time','hidden']
+    list_display = ['name','user','garden','manage','location','location_2','addr','area','mobile','img','img_1','desc','upl_time','hidden']
     # 搜索项:
     search_fields = ['name']
 

+ 1 - 0
apps/AppInfo/models.py

@@ -576,6 +576,7 @@ class GardenArea(models.Model):
     manage = models.CharField(u'负责人', max_length=20, blank=True, null=True)
     garden = models.ForeignKey(GardenManage,blank=True, null=True,verbose_name=u'所属园区')
     location = models.CharField(u'地块坐标', max_length=100, blank=True, null=True)
+    location_2 = models.CharField(u'地块坐标2', max_length=100, blank=True, null=True)
     area = models.CharField('地块面积', max_length=50, blank=True, null=True)
     mobile = models.CharField(u'电话', max_length=20, blank=True, null=True)
     img = models.CharField(u'地块图片', max_length=200, blank=True, null=True)

+ 3 - 1
apps/Equipment/views.py

@@ -3369,6 +3369,7 @@ class Person_Area_Pub(ListView):
         img = request.POST.get('img')
         img_1 = request.POST.get('img_1')
         location = request.POST.get('location')
+        location_2 = request.POST.get('location_2')
         addr = request.POST.get('addr')
         guide_img = request.POST.get('guide_img')
         if GardenArea.objects.filter(user=user).exists():
@@ -3381,6 +3382,7 @@ class Person_Area_Pub(ListView):
                 gar_obj.desc = desc
                 gar_obj.img = img
                 gar_obj.location = location
+                gar_obj.location_2 = location_2
                 gar_obj.addr = addr
                 gar_obj.guide_img = guide_img
                 gar_obj.img_1 = img_1
@@ -3392,7 +3394,7 @@ class Person_Area_Pub(ListView):
         else:
             try:
                 GardenArea.objects.create(user=user,name=name,manage=manage,mobile=mobile,
-                    area=area,desc=desc,img=img,guide_img=guide_img,img_1=img_1,
+                    area=area,desc=desc,img=img,guide_img=guide_img,img_1=img_1,location_2=location_2,
                     location=location,addr=addr)
                 data = "1"
             except Exception as e: