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

modify

parent 5d5b5528
......@@ -4,6 +4,7 @@
"id":{"type":"long"},
"suggest":{"type":"completion"},
"name":{"type":"text","analyzer":"gm_default_index","search_analyzer":"gm_default_index"},
"tag_type":{"type":"long"},
"is_online":{"type":"boolean"},//上线
"is_deleted":{"type":"boolean"},
"near_new_topic_num":{"type":"long"}
......
......@@ -21,7 +21,6 @@ class TopicTag(models.Model):
is_online = models.BooleanField(verbose_name=u"是否在线")
class AccountUserTag(models.Model):
class Meta:
verbose_name=u"用户标签"
......@@ -48,3 +47,32 @@ class Tag(models.Model):
icon_url=models.CharField(verbose_name=u"icon_url",max_length=120)
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 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
import traceback
from libs.tools import tzlc
from trans2es.models.topic import Topic
from trans2es.models.tag import TopicTag
from trans2es.models.tag import TopicTag,CommunityTagType,CommunityTagTypeRelation
import datetime
class TagTransfer(object):
......@@ -35,6 +35,11 @@ class TagTransfer(object):
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
except:
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