예제 #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
파일: helpers.py 프로젝트: zhy0313/hotface
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))