#更改数据库

This commit is contained in:
Bob 2020-10-17 12:21:55 +08:00
parent fb2e227824
commit e6e9ad93bd
1 changed files with 8 additions and 8 deletions

View File

@ -527,7 +527,7 @@ def organization_update(request, pk):
if request.method == 'POST':
name = request.POST.get('name')
image = request.FILES.get('image')
organizationtype = request.POST.get('organizationtype')
# organizationtype = request.POST.get('organizationtype')
province = request.POST.get('province')
level_id = request.POST.get('level')
if province != '' and province.isdigit():
@ -556,7 +556,7 @@ def organization_update(request, pk):
village_r = Area_code_2020.objects.get(name=village).code
if name 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,
town=town_r, village=village_r, level_id=level_id)
o = Organization.objects.get(id=pk)
@ -565,7 +565,7 @@ def organization_update(request, pk):
messages.success(request, '修改成功')
return HttpResponseRedirect('/management/organization/management/')
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,
town=town_r, village=village_r, level_id=level_id)
messages.success(request, '修改成功')
@ -861,7 +861,7 @@ def newmedia_management_edit_weixin(request):
o['code'] = w.code
o['weixinid'] = w.weixinid
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(
w.organization.district) > 0 and len(w.organization.town) > 0 and len(w.organization.village) > 0:
o['administrativedivision'] = str(
@ -928,7 +928,7 @@ def newmedia_management_edit_weibo(request):
o['code'] = w.code
o['weiboid'] = w.weiboid
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(
w.organization.district) > 0 and len(w.organization.town) > 0 and len(w.organization.village) > 0:
o['administrativedivision'] = str(
@ -996,7 +996,7 @@ def newmedia_management_edit_toutiao(request):
o['code'] = w.code
o['toutiaoid'] = w.toutiaoid
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(
w.organization.district) > 0 and len(w.organization.town) > 0 and len(w.organization.village) > 0:
o['administrativedivision'] = str(
@ -1064,7 +1064,7 @@ def newmedia_management_edit_douyin(request):
o['code'] = w.code
o['douyinid'] = w.douyinid
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(
w.organization.district) > 0 and len(w.organization.town) > 0 and len(w.organization.village) > 0:
o['administrativedivision'] = str(
@ -1131,7 +1131,7 @@ def newmedia_management_edit_qita(request):
o['name'] = w.name
o['qitaid'] = w.qitaid
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(
w.organization.district) > 0 and len(w.organization.town) > 0 and len(w.organization.village) > 0:
o['administrativedivision'] = str(