示例#1
0
文件: search.py 项目: eirnym/flaskbb
 def insert_post(cls, writer, post):
     writer.add_document(
         post_id=post.id,
         username=text_type(post.username),
         modified_by=text_type(post.modified_by),
         content=text_type(post.content)
     )
示例#2
0
文件: search.py 项目: eirnym/flaskbb
 def insert_topic(cls, writer, topic):
     writer.add_document(
         topic_id=topic.id,
         title=text_type(topic.title),
         username=text_type(topic.username),
         content=text_type(getattr(topic.first_post, 'content', None))
     )
示例#3
0
 def insert_topic(cls, writer, topic):
     writer.add_document(
         topic_id=topic.id,
         title=text_type(topic.title),
         username=text_type(topic.username),
         content=text_type(getattr(topic.first_post, 'content', None))
     )
示例#4
0
 def insert_post(cls, writer, post):
     writer.add_document(
         post_id=post.id,
         username=text_type(post.username),
         modified_by=text_type(post.modified_by),
         content=text_type(post.content)
     )
示例#5
0
def slugify(text, delim=u'-'):
    """Generates an slightly worse ASCII-only slug.
    Taken from the Flask Snippets page.

   :param text: The text which should be slugified
   :param delim: Default "-". The delimeter for whitespace
    """
    text = unidecode.unidecode(text)
    result = []
    for word in _punct_re.split(text.lower()):
        if word:
            result.append(word)
    return text_type(delim.join(result))
示例#6
0
def slugify(text, delim=u'-'):
    """Generates an slightly worse ASCII-only slug.
    Taken from the Flask Snippets page.

   :param text: The text which should be slugified
   :param delim: Default "-". The delimeter for whitespace
    """
    text = unidecode.unidecode(text)
    result = []
    for word in _punct_re.split(text.lower()):
        if word:
            result.append(word)
    return text_type(delim.join(result))
示例#7
0
 def insert_forum(cls, writer, forum):
     writer.add_document(forum_id=forum.id,
                         title=text_type(forum.title),
                         description=text_type(forum.description))
示例#8
0
 def update_forum(cls, writer, forum):
     writer.update_document(forum_id=forum.id,
                            title=text_type(forum.title),
                            description=text_type(forum.description))
示例#9
0
 def insert_user(cls, writer, user):
     writer.add_document(user_id=user.id,
                         username=text_type(user.username),
                         email=text_type(user.email))
示例#10
0
 def update_user(cls, writer, user):
     writer.update_document(user_id=user.id,
                            username=text_type(user.username),
                            email=text_type(user.email))
示例#11
0
文件: search.py 项目: eirnym/flaskbb
 def update_forum(cls, writer, forum):
     writer.update_document(
         forum_id=forum.id,
         title=text_type(forum.title),
         description=text_type(forum.description)
     )
示例#12
0
文件: search.py 项目: eirnym/flaskbb
 def insert_user(cls, writer, user):
     writer.add_document(
         user_id=user.id,
         username=text_type(user.username),
         email=text_type(user.email)
     )
示例#13
0
文件: search.py 项目: eirnym/flaskbb
 def update_user(cls, writer, user):
     writer.update_document(
         user_id=user.id,
         username=text_type(user.username),
         email=text_type(user.email)
     )
示例#14
0
文件: search.py 项目: eirnym/flaskbb
 def insert_forum(cls, writer, forum):
     writer.add_document(
         forum_id=forum.id,
         title=text_type(forum.title),
         description=text_type(forum.description)
     )
示例#15
0
 def update_topic(cls, writer, topic):
     writer.update_document(
         topic_id=topic.id,
         title=text_type(topic.title),
         user_display_name=text_type(topic.user_display_name),
         content=text_type(getattr(topic.first_post, 'content', None)))
示例#16
0
 def update_post(cls, writer, post):
     writer.update_document(post_id=post.id,
                            user_display_name=text_type(
                                post.user_display_name),
                            modified_by=text_type(post.modified_by),
                            content=text_type(post.content))