Commit 5b7e49a7 authored by 段英荣's avatar 段英荣

modify

parent 5d5b5528
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
"id":{"type":"long"}, "id":{"type":"long"},
"suggest":{"type":"completion"}, "suggest":{"type":"completion"},
"name":{"type":"text","analyzer":"gm_default_index","search_analyzer":"gm_default_index"}, "name":{"type":"text","analyzer":"gm_default_index","search_analyzer":"gm_default_index"},
"tag_type":{"type":"long"},
"is_online":{"type":"boolean"},//上线 "is_online":{"type":"boolean"},//上线
"is_deleted":{"type":"boolean"}, "is_deleted":{"type":"boolean"},
"near_new_topic_num":{"type":"long"} "near_new_topic_num":{"type":"long"}
......
...@@ -21,7 +21,6 @@ class TopicTag(models.Model): ...@@ -21,7 +21,6 @@ class TopicTag(models.Model):
is_online = models.BooleanField(verbose_name=u"是否在线") is_online = models.BooleanField(verbose_name=u"是否在线")
class AccountUserTag(models.Model): class AccountUserTag(models.Model):
class Meta: class Meta:
verbose_name=u"用户标签" verbose_name=u"用户标签"
...@@ -48,3 +47,32 @@ class Tag(models.Model): ...@@ -48,3 +47,32 @@ class Tag(models.Model):
icon_url=models.CharField(verbose_name=u"icon_url",max_length=120) icon_url=models.CharField(verbose_name=u"icon_url",max_length=120)
create_time = models.DateTimeField(verbose_name=u'创建时间',default=datetime.datetime.fromtimestamp(0)) create_time = models.DateTimeField(verbose_name=u'创建时间',default=datetime.datetime.fromtimestamp(0))
update_time = models.DateTimeField(verbose_name=u'更新时间', default=datetime.datetime.fromtimestamp(0)) update_time = models.DateTimeField(verbose_name=u'更新时间', default=datetime.datetime.fromtimestamp(0))
class CommunityTagTypeRelation(models.Model):
class Meta:
verbose_name=u"标签类型对应关系"
db_table="community_tag_type_relation"
id = models.IntegerField(primary_key=True,verbose_name=u"主键ID")
is_deleted = models.BooleanField(verbose_name=u"是否删除")
is_online = models.BooleanField(verbose_name=u"是否上线")
tag_id = models.IntegerField(verbose_name=u"标签ID")
tag_type_id = models.IntegerField(verbose_name=u"标签类型ID")
create_time = models.DateTimeField(verbose_name=u'创建时间',default=datetime.datetime.fromtimestamp(0))
update_time = models.DateTimeField(verbose_name=u'更新时间', default=datetime.datetime.fromtimestamp(0))
class CommunityTagType(models.Model):
class Meta:
verbose_name=u"标签类型"
db_table="community_tag_type"
id = models.IntegerField(primary_key=True,verbose_name=u"主键ID")
is_deleted = models.BooleanField(verbose_name=u"是否删除")
is_online = models.BooleanField(verbose_name=u"是否上线")
name = models.CharField(verbose_name=u"名称",max_length=64)
create_time = models.DateTimeField(verbose_name=u'创建时间',default=datetime.datetime.fromtimestamp(0))
update_time = models.DateTimeField(verbose_name=u'更新时间', default=datetime.datetime.fromtimestamp(0))
...@@ -6,7 +6,7 @@ import logging ...@@ -6,7 +6,7 @@ import logging
import traceback import traceback
from libs.tools import tzlc from libs.tools import tzlc
from trans2es.models.topic import Topic from trans2es.models.topic import Topic
from trans2es.models.tag import TopicTag from trans2es.models.tag import TopicTag,CommunityTagType,CommunityTagTypeRelation
import datetime import datetime
class TagTransfer(object): class TagTransfer(object):
...@@ -35,6 +35,11 @@ class TagTransfer(object): ...@@ -35,6 +35,11 @@ class TagTransfer(object):
res["near_new_topic_num"] = topic_num res["near_new_topic_num"] = topic_num
res["tag_type"] = -1
tag_type_id = CommunityTagTypeRelation.objects.filter(tag_id=instance.id,is_online=True,is_deleted=False).values_list("tag_type_id")
if tag_type_id:
res["tag_type"] = tag_type_id
return res return res
except: except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc()) logging.error("catch exception,err_msg:%s" % traceback.format_exc())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment