This commit is contained in:
baoliang 2020-10-18 00:00:30 +08:00
commit 66a0d92483
25 changed files with 920 additions and 178 deletions

View File

@ -144,6 +144,8 @@ class Userprofile(models.Model):
Organization, on_delete=models.CASCADE, null=True, blank=True) Organization, on_delete=models.CASCADE, null=True, blank=True)
# 用户状态:注册进来默认为0为未审核状态审核后status=1 # 用户状态:注册进来默认为0为未审核状态审核后status=1
status = models.IntegerField('用户状态', null=True, blank=True, default=0) status = models.IntegerField('用户状态', null=True, blank=True, default=0)
#20201017新增字段职位
zhiwei = models.CharField('职位',max_length=256,null=True,blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True) created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True) updated = models.DateTimeField('更新时间', auto_now=True)

View File

@ -99,6 +99,7 @@
<a href="javascript:;"> <a href="javascript:;">
<i class="fa fa-gift"></i> <i class="fa fa-gift"></i>
<span class="title">新媒体管理</span> <span class="title">新媒体管理</span>
<span class="arrow "></span>
{# <span class="arrow "></span><span class="label label-orange">NEW</span>#} {# <span class="arrow "></span><span class="label label-orange">NEW</span>#}
</a> </a>
<ul class="sub-menu"> <ul class="sub-menu">
@ -114,6 +115,7 @@
<a href="javascript:;"> <a href="javascript:;">
<i class="fa fa-envelope"></i> <i class="fa fa-envelope"></i>
<span class="title">主体单位管理</span> <span class="title">主体单位管理</span>
<span class="arrow "></span>
{# <span class="arrow "></span><span class="label label-orange">0</span>#} {# <span class="arrow "></span><span class="label label-orange">0</span>#}
</a> </a>
<ul class="sub-menu"> <ul class="sub-menu">

View File

@ -22,6 +22,7 @@ urlpatterns = [
path('get/village/',views.get_village), path('get/village/',views.get_village),
#单位搜索 #单位搜索
path('get/organization/',views.get_organization,name='get-organization'), path('get/organization/',views.get_organization,name='get-organization'),
path('tencent13722515905013783955.txt', views.wechat_verify, name='wechat-verify') path('tencent13722515905013783955.txt', views.wechat_verify, name='wechat-verify'),
path('import/user',views.import_user)
] ]

View File

@ -1,3 +1,4 @@
import csv
import json import json
import http.client import http.client
import random import random
@ -345,3 +346,24 @@ def get_organization(request):
def wechat_verify(request): def wechat_verify(request):
return HttpResponse("11833201729252855821") return HttpResponse("11833201729252855821")
def import_user(request):
with open('F:/总.csv') as csvfile:
reader = csv.reader(csvfile)
for r in reader:
organization = r[0]
name = r[1]
zhiwei = r[2]
phone = r[3]
o = Organization.objects.get(name=organization)
password = str(phone)[5:]
if phone:
try:
user = User.objects.create_user(username=phone, password=password, last_login=timezone.now())
user.save()
u = Userprofile(user_id=user.id, organization_id=o.id, status=1, image='/profile/user_default.jpg',
sex='', name=name, zhiwei=zhiwei)
u.save()
except:
print(phone)
return HttpResponse('ok')

View File

@ -63,12 +63,24 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="organization">单位</label> <label class="form-label" for="organization">单位</label>
<div class="controls"> {# <div class="controls">#}
<select class="form-control" name="organization"> {# <select class="form-control" name="organization">#}
{% for o in organization %} {# {% for o in organization %}#}
<option value="{{ o.id }}">{{ o.name }}</option> {# <option value="{{ o.id }}">{{ o.name }}</option>#}
{% endfor %} {# {% endfor %}#}
</select> {# </select>#}
{# </div>#}
<div class="input-group main-search">
<input type="text" class="form-control" placeholder="请输入关键字"
style="height: 40px;width: 550px;opacity: .9 "
name="organization">
<div class="input-group-btn" style="display: none">
<button class="btn btn-default" type="button">
<span class="glyphicon glyphicon-search"></span>
</button>
</div>
</div>
<div class="autocomplete-panel" style="z-index: 9999">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -88,6 +100,24 @@
</select> </select>
</div> </div>
</div> </div>
<div class="form-group">
<label class="form-label" for="identificationcode">新媒体标识码</label>
<div class="controls">
<input type="text" class="form-control" name="identificationcode">
</div>
</div>
<div class="form-group">
<label class="form-label" for="function">功能</label>
<div class="controls">
<input type="text" class="form-control" name="function">
</div>
</div>
<div class="form-group">
<label class="form-label" for="articleurl">文章url</label>
<div class="controls">
<input type="text" class="form-control" name="articleurl">
</div>
</div>
<button type="submit" class="btn btn-success" style="margin-top: 50px">点击新建 <button type="submit" class="btn btn-success" style="margin-top: 50px">点击新建
</button> </button>
</form> </form>
@ -102,4 +132,33 @@
</div> </div>
</body> </body>
{% endblock %} {% endblock %}
{% block add_js %}
<script>
$(function () {
$('.main-search input').focus(function (e) {
e.preventDefault();
$("#history_query").hide()
var width = $(this).width();
var position = $(this).position();
var val = $(this).val();
var params = {keyword: val}
if (val) {
$('.autocomplete-panel').load('/get/organization/' + '?' + $.param(params));
}
$('.autocomplete-panel').css({
width: width + 12,
top: position.top + 34,
left: position.left + 5
}).show();
}).blur(function (e) {
e.preventDefault();
}).on('input', function (e) {
var val = $(this).val();
var params = {keyword: val}
$('.autocomplete-panel').load('/get/organization/' + '?' + $.param(params))
});
})
</script>
{% endblock %}

View File

@ -49,7 +49,7 @@
<input type="text" class="form-control" name="type"> <input type="text" class="form-control" name="type">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="name">新媒体名称</label> <label class="form-label" for="name">新媒体名称</label>
<div class="controls"> <div class="controls">
<input type="text" class="form-control" name="name"> <input type="text" class="form-control" name="name">
@ -69,12 +69,24 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="organization">单位</label> <label class="form-label" for="organization">单位</label>
<div class="controls"> {# <div class="controls">#}
<select class="form-control" name="organization"> {# <select class="form-control" name="organization">#}
{% for o in organization %} {# {% for o in organization %}#}
<option value="{{ o.id }}">{{ o.name }}</option> {# <option value="{{ o.id }}">{{ o.name }}</option>#}
{% endfor %} {# {% endfor %}#}
</select> {# </select>#}
{# </div>#}
<div class="input-group main-search">
<input type="text" class="form-control" placeholder="请输入关键字"
style="height: 40px;width: 550px;opacity: .9 "
name="organization">
<div class="input-group-btn" style="display: none">
<button class="btn btn-default" type="button">
<span class="glyphicon glyphicon-search"></span>
</button>
</div>
</div>
<div class="autocomplete-panel" style="z-index: 9999">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -94,6 +106,24 @@
</select> </select>
</div> </div>
</div> </div>
<div class="form-group">
<label class="form-label" for="identificationcode">新媒体标识码</label>
<div class="controls">
<input type="text" class="form-control" name="identificationcode">
</div>
</div>
<div class="form-group">
<label class="form-label" for="function">功能</label>
<div class="controls">
<input type="text" class="form-control" name="function">
</div>
</div>
<div class="form-group">
<label class="form-label" for="articleurl">文章url</label>
<div class="controls">
<input type="text" class="form-control" name="articleurl">
</div>
</div>
<button type="submit" class="btn btn-success" style="margin-top: 50px">点击新建 <button type="submit" class="btn btn-success" style="margin-top: 50px">点击新建
</button> </button>
</form> </form>
@ -108,4 +138,35 @@
</div> </div>
</body> </body>
{% endblock %} {% endblock %}
{% block add_js %}
<script>
$(function () {
$('.main-search input').focus(function (e) {
e.preventDefault();
$("#history_query").hide()
var width = $(this).width();
var position = $(this).position();
var val = $(this).val();
var params = {keyword: val}
if (val) {
$('.autocomplete-panel').load('/get/organization/' + '?' + $.param(params));
}
$('.autocomplete-panel').css({
width: width + 12,
top: position.top + 34,
left: position.left + 5
}).show();
}).blur(function (e) {
e.preventDefault();
}).on('input', function (e) {
var val = $(this).val();
var params = {keyword: val}
$('.autocomplete-panel').load('/get/organization/' + '?' + $.param(params))
});
})
</script>
{% endblock %}

View File

@ -63,12 +63,24 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="organization">单位</label> <label class="form-label" for="organization">单位</label>
<div class="controls"> {# <div class="controls">#}
<select class="form-control" name="organization"> {# <select class="form-control" name="organization">#}
{% for o in organization %} {# {% for o in organization %}#}
<option value="{{ o.id }}">{{ o.name }}</option> {# <option value="{{ o.id }}">{{ o.name }}</option>#}
{% endfor %} {# {% endfor %}#}
</select> {# </select>#}
{# </div>#}
<div class="input-group main-search">
<input type="text" class="form-control" placeholder="请输入关键字"
style="height: 40px;width: 550px;opacity: .9 "
name="organization">
<div class="input-group-btn" style="display: none">
<button class="btn btn-default" type="button">
<span class="glyphicon glyphicon-search"></span>
</button>
</div>
</div>
<div class="autocomplete-panel" style="z-index: 9999">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -88,6 +100,24 @@
</select> </select>
</div> </div>
</div> </div>
<div class="form-group">
<label class="form-label" for="identificationcode">新媒体标识码</label>
<div class="controls">
<input type="text" class="form-control" name="identificationcode">
</div>
</div>
<div class="form-group">
<label class="form-label" for="function">功能</label>
<div class="controls">
<input type="text" class="form-control" name="function">
</div>
</div>
<div class="form-group">
<label class="form-label" for="articleurl">文章url</label>
<div class="controls">
<input type="text" class="form-control" name="articleurl">
</div>
</div>
<button type="submit" class="btn btn-success" style="margin-top: 50px">点击新建 <button type="submit" class="btn btn-success" style="margin-top: 50px">点击新建
</button> </button>
</form> </form>
@ -102,4 +132,34 @@
</div> </div>
</body> </body>
{% endblock %} {% endblock %}
{% block add_js %}
<script>
$(function () {
$('.main-search input').focus(function (e) {
e.preventDefault();
$("#history_query").hide()
var width = $(this).width();
var position = $(this).position();
var val = $(this).val();
var params = {keyword: val}
if (val) {
$('.autocomplete-panel').load('/get/organization/' + '?' + $.param(params));
}
$('.autocomplete-panel').css({
width: width + 12,
top: position.top + 34,
left: position.left + 5
}).show();
}).blur(function (e) {
e.preventDefault();
}).on('input', function (e) {
var val = $(this).val();
var params = {keyword: val}
$('.autocomplete-panel').load('/get/organization/' + '?' + $.param(params))
});
})
</script>
{% endblock %}

View File

@ -50,7 +50,7 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="weiboid">ID</label> <label class="form-label" for="weiboid">BIZ</label>
<div class="controls"> <div class="controls">
<input type="text" class="form-control" name="weiboid"> <input type="text" class="form-control" name="weiboid">
</div> </div>
@ -63,12 +63,24 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="organization">单位</label> <label class="form-label" for="organization">单位</label>
<div class="controls"> {# <div class="controls">#}
<select class="form-control" name="organization"> {# <select class="form-control" name="organization">#}
{% for o in organization %} {# {% for o in organization %}#}
<option value="{{ o.id }}">{{ o.name }}</option> {# <option value="{{ o.id }}">{{ o.name }}</option>#}
{% endfor %} {# {% endfor %}#}
</select> {# </select>#}
{# </div>#}
<div class="input-group main-search">
<input type="text" class="form-control" placeholder="请输入关键字"
style="height: 40px;width: 550px;opacity: .9 "
name="organization">
<div class="input-group-btn" style="display: none">
<button class="btn btn-default" type="button">
<span class="glyphicon glyphicon-search"></span>
</button>
</div>
</div>
<div class="autocomplete-panel" style="z-index: 9999">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -88,6 +100,24 @@
</select> </select>
</div> </div>
</div> </div>
<div class="form-group">
<label class="form-label" for="identificationcode">新媒体标识码</label>
<div class="controls">
<input type="text" class="form-control" name="identificationcode">
</div>
</div>
<div class="form-group">
<label class="form-label" for="function">功能</label>
<div class="controls">
<input type="text" class="form-control" name="function">
</div>
</div>
<div class="form-group">
<label class="form-label" for="articleurl">文章url</label>
<div class="controls">
<input type="text" class="form-control" name="articleurl">
</div>
</div>
<button type="submit" class="btn btn-success" style="margin-top: 50px">点击新建 <button type="submit" class="btn btn-success" style="margin-top: 50px">点击新建
</button> </button>
</form> </form>
@ -102,4 +132,35 @@
</div> </div>
</body> </body>
{% endblock %} {% endblock %}
{% block add_js %}
<script>
$(function () {
$('.main-search input').focus(function (e) {
e.preventDefault();
$("#history_query").hide()
var width = $(this).width();
var position = $(this).position();
var val = $(this).val();
var params = {keyword: val}
if (val) {
$('.autocomplete-panel').load('/get/organization/' + '?' + $.param(params));
}
$('.autocomplete-panel').css({
width: width + 12,
top: position.top + 34,
left: position.left + 5
}).show();
}).blur(function (e) {
e.preventDefault();
}).on('input', function (e) {
var val = $(this).val();
var params = {keyword: val}
$('.autocomplete-panel').load('/get/organization/' + '?' + $.param(params))
});
})
</script>
{% endblock %}

View File

@ -50,7 +50,7 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="weixinid">ID</label> <label class="form-label" for="weixinid">BIZ</label>
<div class="controls"> <div class="controls">
<input type="text" class="form-control" name="weixinid"> <input type="text" class="form-control" name="weixinid">
</div> </div>
@ -63,12 +63,24 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="organization">单位</label> <label class="form-label" for="organization">单位</label>
<div class="controls"> {# <div class="controls">#}
<select class="form-control" name="organization"> {# <select class="form-control" name="organization">#}
{% for o in organization %} {# {% for o in organization %}#}
<option value="{{ o.id }}">{{ o.name }}</option> {# <option value="{{ o.id }}">{{ o.name }}</option>#}
{% endfor %} {# {% endfor %}#}
</select> {# </select>#}
{# </div>#}
<div class="input-group main-search">
<input type="text" class="form-control" placeholder="请输入关键字"
style="height: 40px;width: 550px;opacity: .9 "
name="organization">
<div class="input-group-btn" style="display: none">
<button class="btn btn-default" type="button">
<span class="glyphicon glyphicon-search"></span>
</button>
</div>
</div>
<div class="autocomplete-panel" style="z-index: 9999">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -88,6 +100,24 @@
</select> </select>
</div> </div>
</div> </div>
<div class="form-group">
<label class="form-label" for="identificationcode">新媒体标识码</label>
<div class="controls">
<input type="text" class="form-control" name="identificationcode">
</div>
</div>
<div class="form-group">
<label class="form-label" for="function">功能</label>
<div class="controls">
<input type="text" class="form-control" name="function">
</div>
</div>
<div class="form-group">
<label class="form-label" for="articleurl">文章url</label>
<div class="controls">
<input type="text" class="form-control" name="articleurl">
</div>
</div>
<button type="submit" class="btn btn-success" style="margin-top: 50px">点击新建 <button type="submit" class="btn btn-success" style="margin-top: 50px">点击新建
</button> </button>
</form> </form>
@ -102,4 +132,34 @@
</div> </div>
</body> </body>
{% endblock %} {% endblock %}
{% block add_js %}
<script>
$(function () {
$('.main-search input').focus(function (e) {
e.preventDefault();
$("#history_query").hide()
var width = $(this).width();
var position = $(this).position();
var val = $(this).val();
var params = {keyword: val}
if (val) {
$('.autocomplete-panel').load('/get/organization/' + '?' + $.param(params));
}
$('.autocomplete-panel').css({
width: width + 12,
top: position.top + 34,
left: position.left + 5
}).show();
}).blur(function (e) {
e.preventDefault();
}).on('input', function (e) {
var val = $(this).val();
var params = {keyword: val}
$('.autocomplete-panel').load('/get/organization/' + '?' + $.param(params))
});
})
</script>
{% endblock %}

View File

@ -34,7 +34,6 @@
<th style="text-align: center">新媒体名称</th> <th style="text-align: center">新媒体名称</th>
<th style="text-align: center">新媒体ID</th> <th style="text-align: center">新媒体ID</th>
<th style="text-align: center">责任主体</th> <th style="text-align: center">责任主体</th>
<th style="text-align: center">主体类型</th>
<th style="text-align: center">行政区划</th> <th style="text-align: center">行政区划</th>
<th style="text-align: center">状态</th> <th style="text-align: center">状态</th>
<th style="text-align: center">操作</th> <th style="text-align: center">操作</th>
@ -48,7 +47,6 @@
<td style="vertical-align: middle;text-align: center">{{ w.code }}</td> <td style="vertical-align: middle;text-align: center">{{ w.code }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.douyinid }}</td> <td style="vertical-align: middle;text-align: center">{{ w.douyinid }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.organization }}</td> <td style="vertical-align: middle;text-align: center">{{ w.organization }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.organization_type }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.administrativedivision }}</td> <td style="vertical-align: middle;text-align: center">{{ w.administrativedivision }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.status }}</td> <td style="vertical-align: middle;text-align: center">{{ w.status }}</td>
<td style="vertical-align: middle;text-align: center"> <td style="vertical-align: middle;text-align: center">

View File

@ -35,7 +35,6 @@
<th style="text-align: center">新媒体名称</th> <th style="text-align: center">新媒体名称</th>
<th style="text-align: center">新媒体ID</th> <th style="text-align: center">新媒体ID</th>
<th style="text-align: center">责任主体</th> <th style="text-align: center">责任主体</th>
<th style="text-align: center">主体类型</th>
<th style="text-align: center">行政区划</th> <th style="text-align: center">行政区划</th>
<th style="text-align: center">状态</th> <th style="text-align: center">状态</th>
<th style="text-align: center">操作</th> <th style="text-align: center">操作</th>
@ -50,7 +49,6 @@
<td style="vertical-align: middle;text-align: center">{{ w.name }}</td> <td style="vertical-align: middle;text-align: center">{{ w.name }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.qitaid }}</td> <td style="vertical-align: middle;text-align: center">{{ w.qitaid }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.organization }}</td> <td style="vertical-align: middle;text-align: center">{{ w.organization }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.organization_type }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.administrativedivision }}</td> <td style="vertical-align: middle;text-align: center">{{ w.administrativedivision }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.status }}</td> <td style="vertical-align: middle;text-align: center">{{ w.status }}</td>
<td style="vertical-align: middle;text-align: center"> <td style="vertical-align: middle;text-align: center">

View File

@ -34,7 +34,6 @@
<th style="text-align: center">新媒体名称</th> <th style="text-align: center">新媒体名称</th>
<th style="text-align: center">新媒体ID</th> <th style="text-align: center">新媒体ID</th>
<th style="text-align: center">责任主体</th> <th style="text-align: center">责任主体</th>
<th style="text-align: center">主体类型</th>
<th style="text-align: center">行政区划</th> <th style="text-align: center">行政区划</th>
<th style="text-align: center">状态</th> <th style="text-align: center">状态</th>
<th style="text-align: center">操作</th> <th style="text-align: center">操作</th>
@ -48,7 +47,6 @@
<td style="vertical-align: middle;text-align: center">{{ w.code }}</td> <td style="vertical-align: middle;text-align: center">{{ w.code }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.toutiaoid }}</td> <td style="vertical-align: middle;text-align: center">{{ w.toutiaoid }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.organization }}</td> <td style="vertical-align: middle;text-align: center">{{ w.organization }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.organization_type }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.administrativedivision }}</td> <td style="vertical-align: middle;text-align: center">{{ w.administrativedivision }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.status }}</td> <td style="vertical-align: middle;text-align: center">{{ w.status }}</td>
<td style="vertical-align: middle;text-align: center"> <td style="vertical-align: middle;text-align: center">

View File

@ -34,7 +34,6 @@
<th style="text-align: center">新媒体名称</th> <th style="text-align: center">新媒体名称</th>
<th style="text-align: center">新媒体ID</th> <th style="text-align: center">新媒体ID</th>
<th style="text-align: center">责任主体</th> <th style="text-align: center">责任主体</th>
<th style="text-align: center">主体类型</th>
<th style="text-align: center">行政区划</th> <th style="text-align: center">行政区划</th>
<th style="text-align: center">状态</th> <th style="text-align: center">状态</th>
<th style="text-align: center">操作</th> <th style="text-align: center">操作</th>
@ -48,7 +47,6 @@
<td style="vertical-align: middle;text-align: center">{{ w.code }}</td> <td style="vertical-align: middle;text-align: center">{{ w.code }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.weiboid }}</td> <td style="vertical-align: middle;text-align: center">{{ w.weiboid }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.organization }}</td> <td style="vertical-align: middle;text-align: center">{{ w.organization }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.organization_type }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.administrativedivision }}</td> <td style="vertical-align: middle;text-align: center">{{ w.administrativedivision }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.status }}</td> <td style="vertical-align: middle;text-align: center">{{ w.status }}</td>
<td style="vertical-align: middle;text-align: center"> <td style="vertical-align: middle;text-align: center">

View File

@ -34,7 +34,6 @@
<th style="text-align: center">新媒体名称</th> <th style="text-align: center">新媒体名称</th>
<th style="text-align: center">新媒体ID</th> <th style="text-align: center">新媒体ID</th>
<th style="text-align: center">责任主体</th> <th style="text-align: center">责任主体</th>
<th style="text-align: center">主体类型</th>
<th style="text-align: center">行政区划</th> <th style="text-align: center">行政区划</th>
<th style="text-align: center">状态</th> <th style="text-align: center">状态</th>
<th style="text-align: center">操作</th> <th style="text-align: center">操作</th>
@ -48,7 +47,6 @@
<td style="vertical-align: middle;text-align: center">{{ w.code }}</td> <td style="vertical-align: middle;text-align: center">{{ w.code }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.weixinid }}</td> <td style="vertical-align: middle;text-align: center">{{ w.weixinid }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.organization }}</td> <td style="vertical-align: middle;text-align: center">{{ w.organization }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.organization_type }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.administrativedivision }}</td> <td style="vertical-align: middle;text-align: center">{{ w.administrativedivision }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.status }}</td> <td style="vertical-align: middle;text-align: center">{{ w.status }}</td>
<td style="vertical-align: middle;text-align: center"> <td style="vertical-align: middle;text-align: center">

View File

@ -66,13 +66,25 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="organization">单位</label> <label class="form-label" for="organization">单位</label>
<div class="controls"> {# <div class="controls">#}
<select class="form-control" name="organization"> {# <select class="form-control" name="organization">#}
<option value="{{ douyin.organization.id }}">{{ douyin.organization.name }}</option> {# <option value="{{ douyin.organization.id }}">{{ douyin.organization.name }}</option>#}
{% for o in organization %} {# {% for o in organization %}#}
<option value="{{ o.id }}">{{ o.name }}</option> {# <option value="{{ o.id }}">{{ o.name }}</option>#}
{% endfor %} {# {% endfor %}#}
</select> {# </select>#}
{# </div>#}
<div class="input-group main-search">
<input type="text" class="form-control" placeholder="请输入关键字"
style="height: 40px;width: 550px;opacity: .9 "
name="organization" value="{{ douyin.organization.name }}">
<div class="input-group-btn" style="display: none">
<button class="btn btn-default" type="button">
<span class="glyphicon glyphicon-search"></span>
</button>
</div>
</div>
<div class="autocomplete-panel" style="z-index: 9999">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -96,7 +108,28 @@
</select> </select>
</div> </div>
</div> </div>
<button type="submit" class="btn btn-success" style="margin-top: 50px">点击新建 <div class="form-group">
<label class="form-label" for="identificationcode">新媒体标识码</label>
<div class="controls">
<input type="text" class="form-control" name="identificationcode"
value="{{ douyin.identificationcode }}">
</div>
</div>
<div class="form-group">
<label class="form-label" for="function">功能</label>
<div class="controls">
<input type="text" class="form-control" name="function"
value="{{ douyin.function }}">
</div>
</div>
<div class="form-group">
<label class="form-label" for="articleurl">文章url</label>
<div class="controls">
<input type="text" class="form-control" name="articleurl"
value="{{ douyin.articleurl }}">
</div>
</div>
<button type="submit" class="btn btn-success" style="margin-top: 50px">提交修改
</button> </button>
</form> </form>
</div> </div>
@ -110,4 +143,34 @@
</div> </div>
</body> </body>
{% endblock %} {% endblock %}
{% block add_js %}
<script>
$(function () {
$('.main-search input').focus(function (e) {
e.preventDefault();
$("#history_query").hide()
var width = $(this).width();
var position = $(this).position();
var val = $(this).val();
var params = {keyword: val}
if (val) {
$('.autocomplete-panel').load('/get/organization/' + '?' + $.param(params));
}
$('.autocomplete-panel').css({
width: width + 12,
top: position.top + 34,
left: position.left + 5
}).show();
}).blur(function (e) {
e.preventDefault();
}).on('input', function (e) {
var val = $(this).val();
var params = {keyword: val}
$('.autocomplete-panel').load('/get/organization/' + '?' + $.param(params))
});
})
</script>
{% endblock %}

View File

@ -54,7 +54,7 @@
<label class="form-label" for="name">新媒体名称</label> <label class="form-label" for="name">新媒体名称</label>
<div class="controls"> <div class="controls">
<input type="text" class="form-control" name="name" <input type="text" class="form-control" name="name"
value="{{ qita.name }}"> value="{{ qita.code }}">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -73,13 +73,25 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="organization">单位</label> <label class="form-label" for="organization">单位</label>
<div class="controls"> {# <div class="controls">#}
<select class="form-control" name="organization"> {# <select class="form-control" name="organization">#}
<option value="{{ qita.organization.id }}">{{ qita.organization.name }}</option> {# <option value="{{ qita.organization.id }}">{{ qita.organization.name }}</option>#}
{% for o in organization %} {# {% for o in organization %}#}
<option value="{{ o.id }}">{{ o.name }}</option> {# <option value="{{ o.id }}">{{ o.name }}</option>#}
{% endfor %} {# {% endfor %}#}
</select> {# </select>#}
{# </div>#}
<div class="input-group main-search">
<input type="text" class="form-control" placeholder="请输入关键字"
style="height: 40px;width: 550px;opacity: .9 "
name="organization" value="{{ qita.organization.name }}">
<div class="input-group-btn" style="display: none">
<button class="btn btn-default" type="button">
<span class="glyphicon glyphicon-search"></span>
</button>
</div>
</div>
<div class="autocomplete-panel" style="z-index: 9999">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -103,6 +115,27 @@
</select> </select>
</div> </div>
</div> </div>
<div class="form-group">
<label class="form-label" for="identificationcode">新媒体标识码</label>
<div class="controls">
<input type="text" class="form-control" name="identificationcode"
value="{{ qita.identificationcode }}">
</div>
</div>
<div class="form-group">
<label class="form-label" for="function">功能</label>
<div class="controls">
<input type="text" class="form-control" name="function"
value="{{ qita.function }}">
</div>
</div>
<div class="form-group">
<label class="form-label" for="articleurl">文章url</label>
<div class="controls">
<input type="text" class="form-control" name="articleurl"
value="{{ qita.articleurl }}">
</div>
</div>
<button type="submit" class="btn btn-success" style="margin-top: 50px">点击新建 <button type="submit" class="btn btn-success" style="margin-top: 50px">点击新建
</button> </button>
</form> </form>
@ -117,4 +150,34 @@
</div> </div>
</body> </body>
{% endblock %} {% endblock %}
{% block add_js %}
<script>
$(function () {
$('.main-search input').focus(function (e) {
e.preventDefault();
$("#history_query").hide()
var width = $(this).width();
var position = $(this).position();
var val = $(this).val();
var params = {keyword: val}
if (val) {
$('.autocomplete-panel').load('/get/organization/' + '?' + $.param(params));
}
$('.autocomplete-panel').css({
width: width + 12,
top: position.top + 34,
left: position.left + 5
}).show();
}).blur(function (e) {
e.preventDefault();
}).on('input', function (e) {
var val = $(this).val();
var params = {keyword: val}
$('.autocomplete-panel').load('/get/organization/' + '?' + $.param(params))
});
})
</script>
{% endblock %}

View File

@ -66,13 +66,25 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="organization">单位</label> <label class="form-label" for="organization">单位</label>
<div class="controls"> {# <div class="controls">#}
<select class="form-control" name="organization"> {# <select class="form-control" name="organization">#}
<option value="{{ toutiao.organization.id }}">{{ toutiao.organization.name }}</option> {# <option value="{{ toutiao.organization.id }}">{{ toutiao.organization.name }}</option>#}
{% for o in organization %} {# {% for o in organization %}#}
<option value="{{ o.id }}">{{ o.name }}</option> {# <option value="{{ o.id }}">{{ o.name }}</option>#}
{% endfor %} {# {% endfor %}#}
</select> {# </select>#}
{# </div>#}
<div class="input-group main-search">
<input type="text" class="form-control" placeholder="请输入关键字"
style="height: 40px;width: 550px;opacity: .9 "
name="organization" value="{{ toutiao.organization.name }}">
<div class="input-group-btn" style="display: none">
<button class="btn btn-default" type="button">
<span class="glyphicon glyphicon-search"></span>
</button>
</div>
</div>
<div class="autocomplete-panel" style="z-index: 9999">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -96,7 +108,28 @@
</select> </select>
</div> </div>
</div> </div>
<button type="submit" class="btn btn-success" style="margin-top: 50px">点击新建 <div class="form-group">
<label class="form-label" for="identificationcode">新媒体标识码</label>
<div class="controls">
<input type="text" class="form-control" name="identificationcode"
value="{{ toutiao.identificationcode }}">
</div>
</div>
<div class="form-group">
<label class="form-label" for="function">功能</label>
<div class="controls">
<input type="text" class="form-control" name="function"
value="{{ toutiao.function }}">
</div>
</div>
<div class="form-group">
<label class="form-label" for="articleurl">文章url</label>
<div class="controls">
<input type="text" class="form-control" name="articleurl"
value="{{ toutiao.articleurl }}">
</div>
</div>
<button type="submit" class="btn btn-success" style="margin-top: 50px">提交修改
</button> </button>
</form> </form>
</div> </div>
@ -110,4 +143,34 @@
</div> </div>
</body> </body>
{% endblock %} {% endblock %}
{% block add_js %}
<script>
$(function () {
$('.main-search input').focus(function (e) {
e.preventDefault();
$("#history_query").hide()
var width = $(this).width();
var position = $(this).position();
var val = $(this).val();
var params = {keyword: val}
if (val) {
$('.autocomplete-panel').load('/get/organization/' + '?' + $.param(params));
}
$('.autocomplete-panel').css({
width: width + 12,
top: position.top + 34,
left: position.left + 5
}).show();
}).blur(function (e) {
e.preventDefault();
}).on('input', function (e) {
var val = $(this).val();
var params = {keyword: val}
$('.autocomplete-panel').load('/get/organization/' + '?' + $.param(params))
});
})
</script>
{% endblock %}

View File

@ -66,13 +66,25 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="organization">单位</label> <label class="form-label" for="organization">单位</label>
<div class="controls"> {# <div class="controls">#}
<select class="form-control" name="organization"> {# <select class="form-control" name="organization">#}
<option value="{{ weibo.organization.id }}">{{ weibo.organization.name }}</option> {# <option value="{{ weibo.organization.id }}">{{ weibo.organization.name }}</option>#}
{% for o in organization %} {# {% for o in organization %}#}
<option value="{{ o.id }}">{{ o.name }}</option> {# <option value="{{ o.id }}">{{ o.name }}</option>#}
{% endfor %} {# {% endfor %}#}
</select> {# </select>#}
{# </div>#}
<div class="input-group main-search">
<input type="text" class="form-control" placeholder="请输入关键字"
style="height: 40px;width: 550px;opacity: .9 "
name="organization" value="{{ weibo.organization.name }}">
<div class="input-group-btn" style="display: none">
<button class="btn btn-default" type="button">
<span class="glyphicon glyphicon-search"></span>
</button>
</div>
</div>
<div class="autocomplete-panel" style="z-index: 9999">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -96,7 +108,28 @@
</select> </select>
</div> </div>
</div> </div>
<button type="submit" class="btn btn-success" style="margin-top: 50px">点击新建 <div class="form-group">
<label class="form-label" for="identificationcode">新媒体标识码</label>
<div class="controls">
<input type="text" class="form-control" name="identificationcode"
value="{{ weibo.identificationcode }}">
</div>
</div>
<div class="form-group">
<label class="form-label" for="function">功能</label>
<div class="controls">
<input type="text" class="form-control" name="function"
value="{{ weibo.function }}">
</div>
</div>
<div class="form-group">
<label class="form-label" for="articleurl">文章url</label>
<div class="controls">
<input type="text" class="form-control" name="articleurl"
value="{{ weibo.articleurl }}">
</div>
</div>
<button type="submit" class="btn btn-success" style="margin-top: 50px">提交修改
</button> </button>
</form> </form>
</div> </div>
@ -110,4 +143,34 @@
</div> </div>
</body> </body>
{% endblock %} {% endblock %}
{% block add_js %}
<script>
$(function () {
$('.main-search input').focus(function (e) {
e.preventDefault();
$("#history_query").hide()
var width = $(this).width();
var position = $(this).position();
var val = $(this).val();
var params = {keyword: val}
if (val) {
$('.autocomplete-panel').load('/get/organization/' + '?' + $.param(params));
}
$('.autocomplete-panel').css({
width: width + 12,
top: position.top + 34,
left: position.left + 5
}).show();
}).blur(function (e) {
e.preventDefault();
}).on('input', function (e) {
var val = $(this).val();
var params = {keyword: val}
$('.autocomplete-panel').load('/get/organization/' + '?' + $.param(params))
});
})
</script>
{% endblock %}

View File

@ -66,13 +66,25 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="organization">单位</label> <label class="form-label" for="organization">单位</label>
<div class="controls"> {# <div class="controls">#}
<select class="form-control" name="organization"> {# <select class="form-control" name="organization">#}
<option value="{{ weixin.organization.id }}">{{ weixin.organization.name }}</option> {# <option value="{{ weixin.organization.id }}">{{ weixin.organization.name }}</option>#}
{% for o in organization %} {# {% for o in organization %}#}
<option value="{{ o.id }}">{{ o.name }}</option> {# <option value="{{ o.id }}">{{ o.name }}</option>#}
{% endfor %} {# {% endfor %}#}
</select> {# </select>#}
{# </div>#}
<div class="input-group main-search">
<input type="text" class="form-control" placeholder="请输入关键字"
style="height: 40px;width: 550px;opacity: .9 "
name="organization" value="{{ weixin.organization.name }}">
<div class="input-group-btn" style="display: none">
<button class="btn btn-default" type="button">
<span class="glyphicon glyphicon-search"></span>
</button>
</div>
</div>
<div class="autocomplete-panel" style="z-index: 9999">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -96,6 +108,27 @@
</select> </select>
</div> </div>
</div> </div>
<div class="form-group">
<label class="form-label" for="identificationcode">新媒体标识码</label>
<div class="controls">
<input type="text" class="form-control" name="identificationcode"
value="{{ weixin.identificationcode }}">
</div>
</div>
<div class="form-group">
<label class="form-label" for="function">功能</label>
<div class="controls">
<input type="text" class="form-control" name="function"
value="{{ weixin.function }}">
</div>
</div>
<div class="form-group">
<label class="form-label" for="articleurl">文章url</label>
<div class="controls">
<input type="text" class="form-control" name="articleurl"
value="{{ weixin.articleurl }}">
</div>
</div>
<button type="submit" class="btn btn-primary" style="margin-top: 50px">提交修改 <button type="submit" class="btn btn-primary" style="margin-top: 50px">提交修改
</button> </button>
</form> </form>
@ -110,4 +143,34 @@
</div> </div>
</body> </body>
{% endblock %} {% endblock %}
{% block add_js %}
<script>
$(function () {
$('.main-search input').focus(function (e) {
e.preventDefault();
$("#history_query").hide()
var width = $(this).width();
var position = $(this).position();
var val = $(this).val();
var params = {keyword: val}
if (val) {
$('.autocomplete-panel').load('/get/organization/' + '?' + $.param(params));
}
$('.autocomplete-panel').css({
width: width + 12,
top: position.top + 34,
left: position.left + 5
}).show();
}).blur(function (e) {
e.preventDefault();
}).on('input', function (e) {
var val = $(this).val();
var params = {keyword: val}
$('.autocomplete-panel').load('/get/organization/' + '?' + $.param(params))
});
})
</script>
{% endblock %}

View File

@ -56,7 +56,7 @@
</div> </div>
<div class="panel-body col-md-12"> <div class="panel-body col-md-12">
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="title">新闻</label> <label for="title">新闻发布</label>
<input type="text" class="form-control" id="author" placeholder="请填写新闻作者" <input type="text" class="form-control" id="author" placeholder="请填写新闻作者"
name="author" value="系统管理员"> name="author" value="系统管理员">
</div> </div>
@ -71,7 +71,7 @@
name="source"> name="source">
</div> </div>
<div class="form-group col-md-12" > <div class="form-group col-md-12" >
<label class="form-label" for="image"> <label class="form-label" for="image">缩略
<div class="controls"> <div class="controls">
<input type="file" name="image"> <input type="file" name="image">
</div> </div>

View File

@ -39,9 +39,10 @@
<div class="panel-body"> <div class="panel-body">
{# <div class="panel panel-info">#} {# <div class="panel panel-info">#}
<div class="panel-heading"> <div class="panel-heading">
<div class="col-md-4">新闻类型:{{ news.type }}</div> <div class="col-md-3">新闻类型:{% if news.type == '0' %}政策依据{% elif news.type == '1' %}基层动态{% elif news.type == '2' %}外省动态{% elif news.type == '3' %}监测通报{% elif news.type == '4' %}舆情热点{% elif news.type == '5' %}通知{% elif news.type == '6' %}重点新闻{% endif %}</div>
<div class="col-md-4">作者:{{ news.author }}</div> <div class="col-md-3">发布者:{{ news.author }}</div>
<div class="col-md-4">发布时间:{{ news.date }}</div> <div class="col-md-3">来源:{{ news.source }}</div>
<div class="col-md-3">发布时间:{{ news.date }}</div>
</div> </div>
<div class="panel-body" style="margin-top: 20px"> <div class="panel-body" style="margin-top: 20px">
{{ news.content|safe }} {{ news.content|safe }}

View File

@ -65,34 +65,34 @@
</div> </div>
</label> </label>
</div> </div>
<div class="form-group"> {# <div class="form-group">#}
<label class="form-label" for="organizationtype">单位类型</label> {# <label class="form-label" for="organizationtype">单位类型</label>#}
<div class="controls"> {# <div class="controls">#}
<select class="form-control" name="organizationtype"> {# <select class="form-control" name="organizationtype">#}
<option value="{{ organization.organizationtype.id }}">{{ organization.organizationtype.organizationtype }}</option> {# <option value="{{ organization.organizationtype.id }}">{{ organization.organizationtype.organizationtype }}</option>#}
{% for o in organizationtype %} {# {% for o in organizationtype %}#}
<option value="{{ o.id }}">{{ o.organizationtype }}</option> {# <option value="{{ o.id }}">{{ o.organizationtype }}</option>#}
{% endfor %} {# {% endfor %}#}
</select> {# </select>#}
</div> {# </div>#}
</div> {# </div>#}
<div class="form-group"> <div class="form-group">
<label class="form-label" for="administrativedivision">行政区划</label> <label class="form-label" for="administrativedivision">行政区划</label>
<div class="controls"> <div class="controls">
<select id="province" name="province"> <select id="province" name="province">
<option value="{{ organization.province }}">{{ organization.province }}</option> <option value="{{ p }}">{{ p }}</option>
</select> </select>
<select id="city" name="city" style="margin-left: 20px"> <select id="city" name="city" style="margin-left: 20px">
<option value="{{ organization.province }}">{{ organization.cities }}</option> <option value="{{ c }}">{{ c }}</option>
</select> </select>
<select id="district" name="district" style="margin-left: 20px"> <select id="district" name="district" style="margin-left: 20px">
<option value="{{ organization.province }}">{{ organization.district }}</option> <option value="{{ d }}">{{ d }}</option>
</select> </select>
<select id="town" name="town" style="margin-left: 20px"> <select id="town" name="town" style="margin-left: 20px">
<option value="{{ organization.province }}">{{ organization.town }}</option> <option value="{{ t }}">{{ t }}</option>
</select> </select>
<select id="village" name="village" style="margin-left: 20px"> <select id="village" name="village" style="margin-left: 20px">
<option value="{{ organization.province }}">{{ organization.village }}</option> <option value="{{ v }}">{{ v }}</option>
</select> </select>
</div> </div>
</div> </div>
@ -126,7 +126,7 @@
$(function () { $(function () {
$.get('/get/province/', function (data) { $.get('/get/province/', function (data) {
for (var i = 0, len = data.province.length; i < len; i++) { for (var i = 0, len = data.province.length; i < len; i++) {
$new = $("<option value=" + data.province[i][0] + ">" + data.province[i][1] + "</option>"); $new = $("<option value=" + data.province[i][1] + ">" + data.province[i][1] + "</option>");
$("#province").append($new); $("#province").append($new);
} }
}) })
@ -142,7 +142,7 @@
data: {"code": $(this).val()} data: {"code": $(this).val()}
}).done(function (data) { }).done(function (data) {
for (var i = 0, len = data.city.length; i < len; i++) { for (var i = 0, len = data.city.length; i < len; i++) {
$new = $("<option value=" + data.city[i][0] + ">" + data.city[i][1] + "</option>"); $new = $("<option value=" + data.city[i][1] + ">" + data.city[i][1] + "</option>");
$("#city").append($new); $("#city").append($new);
} }
}) })
@ -158,7 +158,7 @@
data: {"code": $(this).val()} data: {"code": $(this).val()}
}).done(function (data) { }).done(function (data) {
for (var i = 0, len = data.district.length; i < len; i++) { for (var i = 0, len = data.district.length; i < len; i++) {
$new = $("<option value=" + data.district[i][0] + ">" + data.district[i][1] + "</option>"); $new = $("<option value=" + data.district[i][1] + ">" + data.district[i][1] + "</option>");
$("#district").append($new); $("#district").append($new);
} }
}) })
@ -173,7 +173,7 @@
data: {"code": $(this).val()} data: {"code": $(this).val()}
}).done(function (data) { }).done(function (data) {
for (var i = 0, len = data.town.length; i < len; i++) { for (var i = 0, len = data.town.length; i < len; i++) {
$new = $("<option value=" + data.town[i][0] + ">" + data.town[i][1] + "</option>"); $new = $("<option value=" + data.town[i][1] + ">" + data.town[i][1] + "</option>");
$("#town").append($new); $("#town").append($new);
} }
}) })
@ -187,7 +187,7 @@
data: {"code": $(this).val()} data: {"code": $(this).val()}
}).done(function (data) { }).done(function (data) {
for (var i = 0, len = data.village.length; i < len; i++) { for (var i = 0, len = data.village.length; i < len; i++) {
$new = $("<option value=" + data.village[i][0] + ">" + data.village[i][1] + "</option>"); $new = $("<option value=" + data.village[i][1] + ">" + data.village[i][1] + "</option>");
$("#village").append($new); $("#village").append($new);
} }
}) })

View File

@ -58,7 +58,7 @@
<tr> <tr>
<th style="text-align: center">图标</th> <th style="text-align: center">图标</th>
<th style="text-align: center">单位名称</th> <th style="text-align: center">单位名称</th>
<th style="text-align: center">类型</th> {# <th style="text-align: center">类型</th>#}
<th style="text-align: center">行政区划</th> <th style="text-align: center">行政区划</th>
<th style="text-align: center">成员数量</th> <th style="text-align: center">成员数量</th>
<th style="text-align: center">新媒体数量</th> <th style="text-align: center">新媒体数量</th>
@ -72,7 +72,7 @@
src="{{ r.image }}" style="width: 80px;height: 80px;" src="{{ r.image }}" style="width: 80px;height: 80px;"
class="img-circle"></td> class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ r.name }}</td> <td style="vertical-align: middle;text-align: center">{{ r.name }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.organizationtype }}</td> {# <td style="vertical-align: middle;text-align: center">{{ r.organizationtype }}</td>#}
<td style="vertical-align: middle;text-align: center">{{ r.administrativedivision }}</td> <td style="vertical-align: middle;text-align: center">{{ r.administrativedivision }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.usercount }}</td> <td style="vertical-align: middle;text-align: center">{{ r.usercount }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.mediacount }}</td> <td style="vertical-align: middle;text-align: center">{{ r.mediacount }}</td>

View File

@ -34,7 +34,7 @@
<th style="text-align: center">姓名</th> <th style="text-align: center">姓名</th>
<th style="text-align: center">电话</th> <th style="text-align: center">电话</th>
<th style="text-align: center">单位名称</th> <th style="text-align: center">单位名称</th>
<th style="text-align: center">单位类型</th> {# <th style="text-align: center">单位类型</th>#}
<th style="text-align: center">行政区划</th> <th style="text-align: center">行政区划</th>
<th style="text-align: center">操作</th> <th style="text-align: center">操作</th>
</tr> </tr>
@ -47,7 +47,7 @@
<td style="vertical-align: middle;text-align: center">{{ u.name }}</td> <td style="vertical-align: middle;text-align: center">{{ u.name }}</td>
<td style="vertical-align: middle;text-align: center">{{ u.phone }}</td> <td style="vertical-align: middle;text-align: center">{{ u.phone }}</td>
<td style="vertical-align: middle;text-align: center">{{ u.organization }}</td> <td style="vertical-align: middle;text-align: center">{{ u.organization }}</td>
<td style="vertical-align: middle;text-align: center">{{ u.type }}</td> {# <td style="vertical-align: middle;text-align: center">{{ u.type }}</td>#}
<td style="vertical-align: middle;text-align: center">{{ u.administrativedivision }}</td> <td style="vertical-align: middle;text-align: center">{{ u.administrativedivision }}</td>
<td style="vertical-align: middle;text-align: center"> <td style="vertical-align: middle;text-align: center">
<a href="{% url 'user-management-delete' u.id %}" <a href="{% url 'user-management-delete' u.id %}"

View File

@ -50,11 +50,43 @@ def user_management(request):
o['organization'] = u.userprofile_set.get(user_id=u.id).organization.name o['organization'] = u.userprofile_set.get(user_id=u.id).organization.name
organization_id = Userprofile.objects.get(user_id=u.id).organization_id organization_id = Userprofile.objects.get(user_id=u.id).organization_id
print(organization_id) print(organization_id)
o['administrativedivision'] = str(str(Organization.objects.get(id=organization_id).province) + '-' + str( if Organization.objects.get(id=organization_id).province and Organization.objects.get(
Organization.objects.get(id=organization_id).cities) + '-' + str( id=organization_id).cities and Organization.objects.get(
Organization.objects.get(id=organization_id).district) + '-' + str( id=organization_id).district and Organization.objects.get(
Organization.objects.get(id=organization_id).town) + '-' + str( id=organization_id).town and Organization.objects.get(id=organization_id).village:
Organization.objects.get(id=organization_id).village)).replace('None', '') o['administrativedivision'] = str(str(
Area_code_2020.objects.get(code=Organization.objects.get(id=organization_id).province)) + '-' + str(
Area_code_2020.objects.get(code=Organization.objects.get(id=organization_id).cities)) + '-' + str(
Area_code_2020.objects.get(code=Organization.objects.get(id=organization_id).district)) + '-' + str(
Area_code_2020.objects.get(code=Organization.objects.get(id=organization_id).town)) + '-' + str(
Area_code_2020.objects.get(code=Organization.objects.get(id=organization_id).village))).replace(
'None', '')
elif Organization.objects.get(id=organization_id).province and Organization.objects.get(
id=organization_id).cities and Organization.objects.get(
id=organization_id).district and Organization.objects.get(id=organization_id).town:
o['administrativedivision'] = str(str(
Area_code_2020.objects.get(code=Organization.objects.get(id=organization_id).province)) + '-' + str(
Area_code_2020.objects.get(code=Organization.objects.get(id=organization_id).cities)) + '-' + str(
Area_code_2020.objects.get(code=Organization.objects.get(id=organization_id).district)) + '-' + str(
Area_code_2020.objects.get(code=Organization.objects.get(id=organization_id).town))).replace('None',
'')
elif Organization.objects.get(id=organization_id).province and Organization.objects.get(
id=organization_id).cities and Organization.objects.get(id=organization_id).district:
o['administrativedivision'] = str(str(
Area_code_2020.objects.get(code=Organization.objects.get(id=organization_id).province)) + '-' + str(
Area_code_2020.objects.get(code=Organization.objects.get(id=organization_id).cities)) + '-' + str(
Area_code_2020.objects.get(code=Organization.objects.get(id=organization_id).district))).replace(
'None', '')
elif Organization.objects.get(id=organization_id).province and Organization.objects.get(
id=organization_id).cities:
o['administrativedivision'] = str(str(
Area_code_2020.objects.get(code=Organization.objects.get(id=organization_id).province)) + '-' + str(
Area_code_2020.objects.get(code=Organization.objects.get(id=organization_id).cities))).replace(
'None', '')
elif Organization.objects.get(id=organization_id).province:
o['administrativedivision'] = str(str(
Area_code_2020.objects.get(code=Organization.objects.get(id=organization_id).province))).replace(
'None', '')
userallinfo.append(o) userallinfo.append(o)
print(userallinfo) print(userallinfo)
return render(request, 'management/user-management.html', return render(request, 'management/user-management.html',
@ -522,7 +554,22 @@ def organization_delete(request, pk):
@login_required @login_required
def organization_update(request, pk): def organization_update(request, pk):
organization = Organization.objects.get(id=pk) organization = Organization.objects.get(id=pk)
organizationtype = Organizationtype.objects.all() p = ''
c = ''
d = ''
t = ''
v = ''
if organization.province:
p = Area_code_2020.objects.get(code=organization.province).name
if organization.cities:
c = Area_code_2020.objects.get(code=organization.cities).name
if organization.district:
d = Area_code_2020.objects.get(code=organization.district).name
if organization.town:
t = Area_code_2020.objects.get(code=organization.town).name
if organization.village:
v = Area_code_2020.objects.get(code=organization.village).name
level = Level.objects.all() level = Level.objects.all()
if request.method == 'POST': if request.method == 'POST':
name = request.POST.get('name') name = request.POST.get('name')
@ -530,35 +577,26 @@ def organization_update(request, pk):
# 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:
province_r = province province = Area_code_2020.objects.get(name=province).code
else:
province_r = Area_code_2020.objects.get(name=province).code
city = request.POST.get('city') city = request.POST.get('city')
if city != '' and city.isdigit(): print(str(city) + "99999999999999999")
city_r = city if city:
else: city = Area_code_2020.objects.get(name=city).code
city_r = Area_code_2020.objects.get(name=city).code
district = request.POST.get('district') district = request.POST.get('district')
if district != '' and district.isdigit(): if district:
district_r = district district = Area_code_2020.objects.get(name=district).code
else:
district_r = Area_code_2020.objects.get(name=district).code
town = request.POST.get('town') town = request.POST.get('town')
if town != '' and town.isdigit(): if town:
town_r = town town = Area_code_2020.objects.get(name=town).code
else:
town_r = Area_code_2020.objects.get(name=town).code
village = request.POST.get('village') village = request.POST.get('village')
if village != '' and village.isdigit(): if village:
village_r = village village = Area_code_2020.objects.get(name=village).code
else:
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, Organization.objects.filter(id=pk).update(name=name,
province=province_r, cities=city_r, district=district_r, province=province, cities=city, district=district,
town=town_r, village=village_r, level_id=level_id) town=town, village=village, level_id=level_id)
o = Organization.objects.get(id=pk) o = Organization.objects.get(id=pk)
o.image = image o.image = image
o.save() o.save()
@ -566,12 +604,12 @@ def organization_update(request, pk):
return HttpResponseRedirect('/management/organization/management/') return HttpResponseRedirect('/management/organization/management/')
else: else:
Organization.objects.filter(id=pk).update(name=name, Organization.objects.filter(id=pk).update(name=name,
province=province_r, cities=city_r, district=district_r, province=province, cities=city, district=district,
town=town_r, village=village_r, level_id=level_id) town=town, village=village, level_id=level_id)
messages.success(request, '修改成功') messages.success(request, '修改成功')
return HttpResponseRedirect('/management/organization/management/') return HttpResponseRedirect('/management/organization/management/')
return render(request, 'management/organization-management-update.html', return render(request, 'management/organization-management-update.html',
{'organization': organization, 'organizationtype': organizationtype, 'level': level}) {'organization': organization, 'level': level, 'p': p, 'c': c, 'd': d, 't': t, 'v': v})
def organization_create(request): def organization_create(request):
@ -607,7 +645,7 @@ def organization_create(request):
village=village, level_id=level_id, status='0') village=village, level_id=level_id, status='0')
organization.save() organization.save()
messages.success(request, '添加成功') messages.success(request, '添加成功')
return HttpResponseRedirect('/management/organization/management/') return HttpResponseRedirect('/management/organization/create/')
else: else:
messages.error(request, '单位名不能为空') messages.error(request, '单位名不能为空')
return HttpResponseRedirect('/management/organization/create/') return HttpResponseRedirect('/management/organization/create/')
@ -631,19 +669,25 @@ def newmedia_management_create_weixin(request):
weixinid = request.POST.get('weixinid') weixinid = request.POST.get('weixinid')
alias = request.POST.get('alias') alias = request.POST.get('alias')
image = request.FILES.get('image') image = request.FILES.get('image')
organization = request.POST.get('organization') o = request.POST.get('organization')
o_id = Organization.objects.get(name=o).id
status = request.POST.get('status') status = request.POST.get('status')
identificationcode = request.POST.get('identificationcode')
function = request.POST.get('function')
articleurl = request.POST.get('articleurl')
if code is not None: if code is not None:
if organization is not None: if organization is not None:
if image is not None: if image is not None:
weixin = Weixin(code=code, weixinid=weixinid, alias=alias, image=image, weixin = Weixin(code=code, weixinid=weixinid, alias=alias, image=image,
organization_id=organization, status=status) organization_id=o_id, status=status, identificationcode=identificationcode,
function=function, articleurl=articleurl)
weixin.save() weixin.save()
messages.success(request, '创建成功') messages.success(request, '创建成功')
return HttpResponseRedirect('/management/newmedia/management/create/weixin/') return HttpResponseRedirect('/management/newmedia/management/create/weixin/')
else: else:
weixin = Weixin(code=code, weixinid=weixinid, alias=alias, image='weixin.png', weixin = Weixin(code=code, weixinid=weixinid, alias=alias, image='weixin.png',
organization_id=organization, status=status) organization_id=o_id, status=status, identificationcode=identificationcode,
function=function, articleurl=articleurl)
weixin.save() weixin.save()
messages.success(request, '创建成功') messages.success(request, '创建成功')
return HttpResponseRedirect('/management/newmedia/management/create/weixin/') return HttpResponseRedirect('/management/newmedia/management/create/weixin/')
@ -671,19 +715,25 @@ def newmedia_management_create_weibo(request):
print(str(weiboid) + "11111111111111111111111111111111111111") print(str(weiboid) + "11111111111111111111111111111111111111")
alias = request.POST.get('alias') alias = request.POST.get('alias')
image = request.FILES.get('image') image = request.FILES.get('image')
organization = request.POST.get('organization') o = request.POST.get('organization')
o_id = Organization.objects.get(name=o).id
status = request.POST.get('status') status = request.POST.get('status')
identificationcode = request.POST.get('identificationcode')
function = request.POST.get('function')
articleurl = request.POST.get('articleurl')
if code is not None: if code is not None:
if organization is not None: if organization is not None:
if image is not None: if image is not None:
weibo = Weibo(code=code, weiboid=weiboid, alias=alias, image=image, weibo = Weibo(code=code, weiboid=weiboid, alias=alias, image=image,
organization_id=organization, status=status) organization_id=o_id, status=status, identificationcode=identificationcode,
function=function, articleurl=articleurl)
weibo.save() weibo.save()
messages.success(request, '创建成功') messages.success(request, '创建成功')
return HttpResponseRedirect('/management/newmedia/management/create/weibo/') return HttpResponseRedirect('/management/newmedia/management/create/weibo/')
else: else:
weibo = Weibo(code=code, weiboid=weiboid, alias=alias, image='weibo.png', weibo = Weibo(code=code, weiboid=weiboid, alias=alias, image='weibo.png',
organization_id=organization, status=status) organization_id=o_id, status=status, identificationcode=identificationcode,
function=function, articleurl=articleurl)
weibo.save() weibo.save()
messages.success(request, '创建成功') messages.success(request, '创建成功')
return HttpResponseRedirect('/management/newmedia/management/create/weibo/') return HttpResponseRedirect('/management/newmedia/management/create/weibo/')
@ -710,19 +760,25 @@ def newmedia_management_create_toutiao(request):
toutiaoid = request.POST.get('toutiaoid') toutiaoid = request.POST.get('toutiaoid')
alias = request.POST.get('alias') alias = request.POST.get('alias')
image = request.FILES.get('image') image = request.FILES.get('image')
organization = request.POST.get('organization') o = request.POST.get('organization')
o_id = Organization.objects.get(name=o).id
status = request.POST.get('status') status = request.POST.get('status')
identificationcode = request.POST.get('identificationcode')
function = request.POST.get('function')
articleurl = request.POST.get('articleurl')
if code is not None: if code is not None:
if organization is not None: if organization is not None:
if image is not None: if image is not None:
toutiao = Toutiao(code=code, toutiaoid=toutiaoid, alias=alias, image=image, toutiao = Toutiao(code=code, toutiaoid=toutiaoid, alias=alias, image=image,
organization_id=organization, status=status) organization_id=o_id, status=status,
identificationcode=identificationcode, function=function, articleurl=articleurl)
toutiao.save() toutiao.save()
messages.success(request, '创建成功') messages.success(request, '创建成功')
return HttpResponseRedirect('/management/newmedia/management/create/toutiao/') return HttpResponseRedirect('/management/newmedia/management/create/toutiao/')
else: else:
toutiao = Toutiao(code=code, toutiaoid=toutiaoid, alias=alias, image='toutiao.png', toutiao = Toutiao(code=code, toutiaoid=toutiaoid, alias=alias, image='toutiao.png',
organization_id=organization, status=status) organization_id=o_id, status=status,
identificationcode=identificationcode, function=function, articleurl=articleurl)
toutiao.save() toutiao.save()
messages.success(request, '创建成功') messages.success(request, '创建成功')
return HttpResponseRedirect('/management/newmedia/management/create/toutiao/') return HttpResponseRedirect('/management/newmedia/management/create/toutiao/')
@ -751,19 +807,25 @@ def newmedia_management_create_douyin(request):
douyinid = request.POST.get('douyinid') douyinid = request.POST.get('douyinid')
alias = request.POST.get('alias') alias = request.POST.get('alias')
image = request.FILES.get('image') image = request.FILES.get('image')
organization = request.POST.get('organization') o = request.POST.get('organization')
o_id = Organization.objects.get(name=o).id
status = request.POST.get('status') status = request.POST.get('status')
identificationcode = request.POST.get('identificationcode')
function = request.POST.get('function')
articleurl = request.POST.get('articleurl')
if code is not None: if code is not None:
if organization is not None: if organization is not None:
if image is not None: if image is not None:
douyin = Douyin(code=code, douyinid=douyinid, alias=alias, image=image, douyin = Douyin(code=code, douyinid=douyinid, alias=alias, image=image,
organization_id=organization, status=status) organization_id=o_id, status=status, identificationcode=identificationcode,
function=function, articleurl=articleurl)
douyin.save() douyin.save()
messages.success(request, '创建成功') messages.success(request, '创建成功')
return HttpResponseRedirect('/management/newmedia/management/create/douyin/') return HttpResponseRedirect('/management/newmedia/management/create/douyin/')
else: else:
douyin = Douyin(code=code, douyinid=douyinid, alias=alias, image='douyin.png', douyin = Douyin(code=code, douyinid=douyinid, alias=alias, image='douyin.png',
organization_id=organization, status=status) organization_id=o_id, status=status, identificationcode=identificationcode,
function=function, articleurl=articleurl)
douyin.save() douyin.save()
messages.success(request, '创建成功') messages.success(request, '创建成功')
return HttpResponseRedirect('/management/newmedia/management/create/douyin/') return HttpResponseRedirect('/management/newmedia/management/create/douyin/')
@ -792,19 +854,25 @@ def newmedia_management_create_qita(request):
qitaid = request.POST.get('qitaid') qitaid = request.POST.get('qitaid')
alias = request.POST.get('alias') alias = request.POST.get('alias')
image = request.FILES.get('image') image = request.FILES.get('image')
organization = request.POST.get('organization') o = request.POST.get('organization')
o_id = Organization.objects.get(name=o).id
status = request.POST.get('status') status = request.POST.get('status')
identificationcode = request.POST.get('identificationcode')
function = request.POST.get('function')
articleurl = request.POST.get('articleurl')
if name is not None: if name is not None:
if organization is not None: if organization is not None:
if image is not None: if image is not None:
qita = Qita(type=type, name=name, qitaid=qitaid, alias=alias, image=image, qita = Qita(type=type, name=name, qitaid=qitaid, alias=alias, image=image,
organization_id=organization, status=status) organization_id=o_id, status=status, identificationcode=identificationcode,
function=function, articleurl=articleurl)
qita.save() qita.save()
messages.success(request, '创建成功') messages.success(request, '创建成功')
return HttpResponseRedirect('/management/newmedia/management/create/qita/') return HttpResponseRedirect('/management/newmedia/management/create/qita/')
else: else:
qita = Qita(type=type, name=name, qitaid=qitaid, alias=alias, image='qita.png', qita = Qita(type=type, name=name, qitaid=qitaid, alias=alias, image='qita.png',
organization_id=organization, status=status) organization_id=o_id, status=status, identificationcode=identificationcode,
function=function, articleurl=articleurl)
qita.save() qita.save()
messages.success(request, '创建成功') messages.success(request, '创建成功')
return HttpResponseRedirect('/management/newmedia/management/create/qita/') return HttpResponseRedirect('/management/newmedia/management/create/qita/')
@ -1128,7 +1196,7 @@ def newmedia_management_edit_qita(request):
o['id'] = str(w.id) o['id'] = str(w.id)
o['image'] = w.image o['image'] = w.image
o['type'] = w.type o['type'] = w.type
o['name'] = w.name o['name'] = w.code
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
@ -1176,20 +1244,28 @@ def newmedia_management_update_weixin(request, pk):
weixinid = request.POST.get('weixinid') weixinid = request.POST.get('weixinid')
alias = request.POST.get('alias') alias = request.POST.get('alias')
image = request.FILES.get('image') image = request.FILES.get('image')
organization = request.POST.get('organization') o = request.POST.get('organization')
o_id = Organization.objects.get(name=o).id
status = request.POST.get('status') status = request.POST.get('status')
identificationcode = request.POST.get('identificationcode')
function = request.POST.get('function')
articleurl = request.POST.get('articleurl')
if code is not None: if code is not None:
if organization is not None: if organization is not None:
if image is not None: if image is not None:
Weixin.objects.filter(id=pk).update(code=code, weixinid=weixinid, alias=alias, Weixin.objects.filter(id=pk).update(code=code, weixinid=weixinid, alias=alias,
organization_id=organization, status=status) organization_id=o_id, status=status,
identificationcode=identificationcode, function=function,
articleurl=articleurl)
weixin.image = image weixin.image = image
weixin.save() weixin.save()
messages.success(request, '修改成功') messages.success(request, '修改成功')
return HttpResponseRedirect('/management/newmedia/management/edit/weixin/') return HttpResponseRedirect('/management/newmedia/management/edit/weixin/')
else: else:
Weixin.objects.filter(id=pk).update(code=code, weixinid=weixinid, alias=alias, Weixin.objects.filter(id=pk).update(code=code, weixinid=weixinid, alias=alias,
organization_id=organization, status=status) organization_id=o_id, status=status,
identificationcode=identificationcode, function=function,
articleurl=articleurl)
messages.success(request, '修改成功') messages.success(request, '修改成功')
return HttpResponseRedirect('/management/newmedia/management/edit/weixin/') return HttpResponseRedirect('/management/newmedia/management/edit/weixin/')
else: else:
@ -1219,20 +1295,28 @@ def newmedia_management_update_weibo(request, pk):
weiboid = request.POST.get('weiboid') weiboid = request.POST.get('weiboid')
alias = request.POST.get('alias') alias = request.POST.get('alias')
image = request.FILES.get('image') image = request.FILES.get('image')
organization = request.POST.get('organization') o = request.POST.get('organization')
o_id = Organization.objects.get(name=o).id
status = request.POST.get('status') status = request.POST.get('status')
identificationcode = request.POST.get('identificationcode')
function = request.POST.get('function')
articleurl = request.POST.get('articleurl')
if code is not None: if code is not None:
if organization is not None: if organization is not None:
if image is not None: if image is not None:
Weibo.objects.filter(id=pk).update(code=code, weiboid=weiboid, alias=alias, Weibo.objects.filter(id=pk).update(code=code, weiboid=weiboid, alias=alias,
organization_id=organization, status=status) organization_id=o_id, status=status,
identificationcode=identificationcode, function=function,
articleurl=articleurl)
weibo.image = image weibo.image = image
weibo.save() weibo.save()
messages.success(request, '修改成功') messages.success(request, '修改成功')
return HttpResponseRedirect('/management/newmedia/management/edit/weibo/') return HttpResponseRedirect('/management/newmedia/management/edit/weibo/')
else: else:
Weibo.objects.filter(id=pk).update(code=code, weiboid=weiboid, alias=alias, Weibo.objects.filter(id=pk).update(code=code, weiboid=weiboid, alias=alias,
organization_id=organization, status=status) organization_id=o_id, status=status,
identificationcode=identificationcode, function=function,
articleurl=articleurl)
messages.success(request, '修改成功') messages.success(request, '修改成功')
return HttpResponseRedirect('/management/newmedia/management/edit/weibo/') return HttpResponseRedirect('/management/newmedia/management/edit/weibo/')
else: else:
@ -1262,20 +1346,28 @@ def newmedia_management_update_toutiao(request, pk):
toutiaoid = request.POST.get('toutiaoid') toutiaoid = request.POST.get('toutiaoid')
alias = request.POST.get('alias') alias = request.POST.get('alias')
image = request.FILES.get('image') image = request.FILES.get('image')
organization = request.POST.get('organization') o = request.POST.get('organization')
o_id = Organization.objects.get(name=o).id
status = request.POST.get('status') status = request.POST.get('status')
identificationcode = request.POST.get('identificationcode')
function = request.POST.get('function')
articleurl = request.POST.get('articleurl')
if code is not None: if code is not None:
if organization is not None: if organization is not None:
if image is not None: if image is not None:
Toutiao.objects.filter(id=pk).update(code=code, toutiaoid=toutiaoid, alias=alias, Toutiao.objects.filter(id=pk).update(code=code, toutiaoid=toutiaoid, alias=alias,
organization_id=organization, status=status) organization_id=o_id, status=status,
identificationcode=identificationcode, function=function,
articleurl=articleurl)
toutiao.image = image toutiao.image = image
toutiao.save() toutiao.save()
messages.success(request, '修改成功') messages.success(request, '修改成功')
return HttpResponseRedirect('/management/newmedia/management/edit/toutiao/') return HttpResponseRedirect('/management/newmedia/management/edit/toutiao/')
else: else:
Toutiao.objects.filter(id=pk).update(code=code, toutiaoid=toutiaoid, alias=alias, Toutiao.objects.filter(id=pk).update(code=code, toutiaoid=toutiaoid, alias=alias,
organization_id=organization, status=status) organization_id=o_id, status=status,
identificationcode=identificationcode, function=function,
articleurl=articleurl)
messages.success(request, '修改成功') messages.success(request, '修改成功')
return HttpResponseRedirect('/management/newmedia/management/edit/toutiao/') return HttpResponseRedirect('/management/newmedia/management/edit/toutiao/')
else: else:
@ -1305,20 +1397,28 @@ def newmedia_management_update_douyin(request, pk):
douyinid = request.POST.get('douyinid') douyinid = request.POST.get('douyinid')
alias = request.POST.get('alias') alias = request.POST.get('alias')
image = request.FILES.get('image') image = request.FILES.get('image')
organization = request.POST.get('organization') o = request.POST.get('organization')
o_id = Organization.objects.get(name=o).id
status = request.POST.get('status') status = request.POST.get('status')
identificationcode = request.POST.get('identificationcode')
function = request.POST.get('function')
articleurl = request.POST.get('articleurl')
if code is not None: if code is not None:
if organization is not None: if organization is not None:
if image is not None: if image is not None:
Douyin.objects.filter(id=pk).update(code=code, douyinid=douyinid, alias=alias, Douyin.objects.filter(id=pk).update(code=code, douyinid=douyinid, alias=alias,
organization_id=organization, status=status) organization_id=o_id, status=status,
identificationcode=identificationcode, function=function,
articleurl=articleurl)
douyin.image = image douyin.image = image
douyin.save() douyin.save()
messages.success(request, '修改成功') messages.success(request, '修改成功')
return HttpResponseRedirect('/management/newmedia/management/edit/douyin/') return HttpResponseRedirect('/management/newmedia/management/edit/douyin/')
else: else:
Douyin.objects.filter(id=pk).update(code=code, douyinid=douyinid, alias=alias, Douyin.objects.filter(id=pk).update(code=code, douyinid=douyinid, alias=alias,
organization_id=organization, status=status) organization_id=o_id, status=status,
identificationcode=identificationcode, function=function,
articleurl=articleurl)
messages.success(request, '修改成功') messages.success(request, '修改成功')
return HttpResponseRedirect('/management/newmedia/management/edit/douyin/') return HttpResponseRedirect('/management/newmedia/management/edit/douyin/')
else: else:
@ -1349,20 +1449,28 @@ def newmedia_management_update_qita(request, pk):
qitaid = request.POST.get('qitaid') qitaid = request.POST.get('qitaid')
alias = request.POST.get('alias') alias = request.POST.get('alias')
image = request.FILES.get('image') image = request.FILES.get('image')
organization = request.POST.get('organization') o = request.POST.get('organization')
o_id = Organization.objects.get(name=o).id
status = request.POST.get('status') status = request.POST.get('status')
identificationcode = request.POST.get('identificationcode')
function = request.POST.get('function')
articleurl = request.POST.get('articleurl')
if name is not None: if name is not None:
if organization is not None: if organization is not None:
if image is not None: if image is not None:
Qita.objects.filter(id=pk).update(type=type, name=name, qitaid=qitaid, alias=alias, Qita.objects.filter(id=pk).update(type=type, code=name, qitaid=qitaid, alias=alias,
organization_id=organization, status=status) organization_id=o_id, status=status,
identificationcode=identificationcode, function=function,
articleurl=articleurl)
qita.image = image qita.image = image
qita.save() qita.save()
messages.success(request, '修改成功') messages.success(request, '修改成功')
return HttpResponseRedirect('/management/newmedia/management/edit/qita/') return HttpResponseRedirect('/management/newmedia/management/edit/qita/')
else: else:
Qita.objects.filter(id=pk).update(type=type, name=name, qitaid=qitaid, alias=alias, Qita.objects.filter(id=pk).update(type=type, code=name, qitaid=qitaid, alias=alias,
organization_id=organization, status=status) organization_id=o_id, status=status,
identificationcode=identificationcode, function=function,
articleurl=articleurl)
messages.success(request, '修改成功') messages.success(request, '修改成功')
return HttpResponseRedirect('/management/newmedia/management/edit/qita/') return HttpResponseRedirect('/management/newmedia/management/edit/qita/')
else: else: