#更改数据库
This commit is contained in:
parent
fb2e227824
commit
e6e9ad93bd
|
@ -527,7 +527,7 @@ def organization_update(request, pk):
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
name = request.POST.get('name')
|
name = request.POST.get('name')
|
||||||
image = request.FILES.get('image')
|
image = request.FILES.get('image')
|
||||||
organizationtype = request.POST.get('organizationtype')
|
# organizationtype = request.POST.get('organizationtype')
|
||||||
province = request.POST.get('province')
|
province = request.POST.get('province')
|
||||||
level_id = request.POST.get('level')
|
level_id = request.POST.get('level')
|
||||||
if province != '' and province.isdigit():
|
if province != '' and province.isdigit():
|
||||||
|
@ -556,7 +556,7 @@ def organization_update(request, pk):
|
||||||
village_r = Area_code_2020.objects.get(name=village).code
|
village_r = Area_code_2020.objects.get(name=village).code
|
||||||
if name is not None:
|
if name is not None:
|
||||||
if image is not None:
|
if image is not None:
|
||||||
Organization.objects.filter(id=pk).update(name=name, organizationtype_id=organizationtype,
|
Organization.objects.filter(id=pk).update(name=name,
|
||||||
province=province_r, cities=city_r, district=district_r,
|
province=province_r, cities=city_r, district=district_r,
|
||||||
town=town_r, village=village_r, level_id=level_id)
|
town=town_r, village=village_r, level_id=level_id)
|
||||||
o = Organization.objects.get(id=pk)
|
o = Organization.objects.get(id=pk)
|
||||||
|
@ -565,7 +565,7 @@ def organization_update(request, pk):
|
||||||
messages.success(request, '修改成功')
|
messages.success(request, '修改成功')
|
||||||
return HttpResponseRedirect('/management/organization/management/')
|
return HttpResponseRedirect('/management/organization/management/')
|
||||||
else:
|
else:
|
||||||
Organization.objects.filter(id=pk).update(name=name, organizationtype_id=organizationtype,
|
Organization.objects.filter(id=pk).update(name=name,
|
||||||
province=province_r, cities=city_r, district=district_r,
|
province=province_r, cities=city_r, district=district_r,
|
||||||
town=town_r, village=village_r, level_id=level_id)
|
town=town_r, village=village_r, level_id=level_id)
|
||||||
messages.success(request, '修改成功')
|
messages.success(request, '修改成功')
|
||||||
|
@ -861,7 +861,7 @@ def newmedia_management_edit_weixin(request):
|
||||||
o['code'] = w.code
|
o['code'] = w.code
|
||||||
o['weixinid'] = w.weixinid
|
o['weixinid'] = w.weixinid
|
||||||
o['organization'] = w.organization.name
|
o['organization'] = w.organization.name
|
||||||
o['organization_type'] = w.organization.organizationtype.organizationtype
|
# o['organization_type'] = w.organization.organizationtype.organizationtype
|
||||||
if len(w.organization.province) > 0 and len(w.organization.cities) > 0 and len(
|
if len(w.organization.province) > 0 and len(w.organization.cities) > 0 and len(
|
||||||
w.organization.district) > 0 and len(w.organization.town) > 0 and len(w.organization.village) > 0:
|
w.organization.district) > 0 and len(w.organization.town) > 0 and len(w.organization.village) > 0:
|
||||||
o['administrativedivision'] = str(
|
o['administrativedivision'] = str(
|
||||||
|
@ -928,7 +928,7 @@ def newmedia_management_edit_weibo(request):
|
||||||
o['code'] = w.code
|
o['code'] = w.code
|
||||||
o['weiboid'] = w.weiboid
|
o['weiboid'] = w.weiboid
|
||||||
o['organization'] = w.organization.name
|
o['organization'] = w.organization.name
|
||||||
o['organization_type'] = w.organization.organizationtype.organizationtype
|
# o['organization_type'] = w.organization.organizationtype.organizationtype
|
||||||
if len(w.organization.province) > 0 and len(w.organization.cities) > 0 and len(
|
if len(w.organization.province) > 0 and len(w.organization.cities) > 0 and len(
|
||||||
w.organization.district) > 0 and len(w.organization.town) > 0 and len(w.organization.village) > 0:
|
w.organization.district) > 0 and len(w.organization.town) > 0 and len(w.organization.village) > 0:
|
||||||
o['administrativedivision'] = str(
|
o['administrativedivision'] = str(
|
||||||
|
@ -996,7 +996,7 @@ def newmedia_management_edit_toutiao(request):
|
||||||
o['code'] = w.code
|
o['code'] = w.code
|
||||||
o['toutiaoid'] = w.toutiaoid
|
o['toutiaoid'] = w.toutiaoid
|
||||||
o['organization'] = w.organization.name
|
o['organization'] = w.organization.name
|
||||||
o['organization_type'] = w.organization.organizationtype.organizationtype
|
# o['organization_type'] = w.organization.organizationtype.organizationtype
|
||||||
if len(w.organization.province) > 0 and len(w.organization.cities) > 0 and len(
|
if len(w.organization.province) > 0 and len(w.organization.cities) > 0 and len(
|
||||||
w.organization.district) > 0 and len(w.organization.town) > 0 and len(w.organization.village) > 0:
|
w.organization.district) > 0 and len(w.organization.town) > 0 and len(w.organization.village) > 0:
|
||||||
o['administrativedivision'] = str(
|
o['administrativedivision'] = str(
|
||||||
|
@ -1064,7 +1064,7 @@ def newmedia_management_edit_douyin(request):
|
||||||
o['code'] = w.code
|
o['code'] = w.code
|
||||||
o['douyinid'] = w.douyinid
|
o['douyinid'] = w.douyinid
|
||||||
o['organization'] = w.organization.name
|
o['organization'] = w.organization.name
|
||||||
o['organization_type'] = w.organization.organizationtype.organizationtype
|
# o['organization_type'] = w.organization.organizationtype.organizationtype
|
||||||
if len(w.organization.province) > 0 and len(w.organization.cities) > 0 and len(
|
if len(w.organization.province) > 0 and len(w.organization.cities) > 0 and len(
|
||||||
w.organization.district) > 0 and len(w.organization.town) > 0 and len(w.organization.village) > 0:
|
w.organization.district) > 0 and len(w.organization.town) > 0 and len(w.organization.village) > 0:
|
||||||
o['administrativedivision'] = str(
|
o['administrativedivision'] = str(
|
||||||
|
@ -1131,7 +1131,7 @@ def newmedia_management_edit_qita(request):
|
||||||
o['name'] = w.name
|
o['name'] = w.name
|
||||||
o['qitaid'] = w.qitaid
|
o['qitaid'] = w.qitaid
|
||||||
o['organization'] = w.organization.name
|
o['organization'] = w.organization.name
|
||||||
o['organization_type'] = w.organization.organizationtype.organizationtype
|
# o['organization_type'] = w.organization.organizationtype.organizationtype
|
||||||
if len(w.organization.province) > 0 and len(w.organization.cities) > 0 and len(
|
if len(w.organization.province) > 0 and len(w.organization.cities) > 0 and len(
|
||||||
w.organization.district) > 0 and len(w.organization.town) > 0 and len(w.organization.village) > 0:
|
w.organization.district) > 0 and len(w.organization.town) > 0 and len(w.organization.village) > 0:
|
||||||
o['administrativedivision'] = str(
|
o['administrativedivision'] = str(
|
||||||
|
|
Loading…
Reference in New Issue