Beispiel #1
0
    def insert_data(self, post_data):
        title = post_data["title"][0]
        uu = self.get_by_wiki(title)
        if uu is None:
            pass
        else:
            return False

        if post_data["src_type"][0] == "1":
            cnt_html = tools.rst2html(post_data["cnt_md"][0])
        else:
            cnt_html = tools.markdown2html(post_data["cnt_md"][0])

        entry = CabWiki.create(
            title=post_data["title"][0],
            date=datetime.datetime.now(),
            cnt_html=cnt_html,
            uid=tools.get_uu8d(),
            time_create=tools.timestamp(),
            user_name=post_data["user_name"],
            cnt_md=tornado.escape.xhtml_escape(post_data["cnt_md"][0]),
            time_update=tools.timestamp(),
            view_count=1,
            src_type=post_data["src_type"][0],
        )
        return entry.uid
Beispiel #2
0
    def insert_data(self, post_data):
        title = post_data['title'][0]
        uu = self.get_by_wiki(title)
        if uu is None:
            pass
        else:
            return (False)
        if 'id_spec' in post_data:
            id_spec = post_data['id_spec'][0]
        else:
            id_spec = 0
        if post_data['src_type'][0] == '1':
            cnt_html = tools.rst2html(post_data['cnt_md'][0])
        else:
            cnt_html = tools.markdown2html(post_data['cnt_md'][0])

        entry = CabWiki.create(title=post_data['title'][0],
                               date=datetime.datetime.now(),
                               cnt_html=cnt_html,
                               uid=tools.get_uu8d(),
                               time_create=time.time(),
                               user_name=post_data['user_name'],
                               cnt_md=tornado.escape.xhtml_escape(
                                   post_data['cnt_md'][0]),
                               time_update=time.time(),
                               view_count=1,
                               src_type=post_data['src_type'][0])
        return (entry.uid)
Beispiel #3
0
    def insert_data(self, post_data):
        title = post_data['title'][0]
        uu = self.get_by_wiki(title)
        if uu is None:
            pass
        else:
            return (False)
        if 'id_spec' in post_data:
            id_spec = post_data['id_spec'][0]
        else:
            id_spec = 0
        if post_data['src_type'][0] == '1':
            cnt_html = tools.rst2html(post_data['cnt_md'][0])
        else:
            cnt_html = tools.markdown2html(post_data['cnt_md'][0])

        entry = CabWiki.create(
            title=post_data['title'][0],
            date=datetime.datetime.now(),
            cnt_html=cnt_html,
            uid=tools.get_uu8d(),
            time_create=time.time(),
            user_name=post_data['user_name'],
            cnt_md=tornado.escape.xhtml_escape(post_data['cnt_md'][0]),
            time_update=time.time(),
            view_count=1,
            src_type=post_data['src_type'][0]
        )
        return (entry.uid)
Beispiel #4
0
    def insert_data(self, post_data):
        title = post_data['title'][0]
        uu = self.get_by_wiki(title)
        if uu is None:
            pass
        else:
            return (False)

        cnt_html = tools.markdown2html(post_data['cnt_md'][0])

        entry = CabWiki.create(
            title=post_data['title'][0],
            date=datetime.datetime.now(),
            cnt_html=cnt_html,
            uid=tools.get_uu8d(),
            time_create=tools.timestamp(),
            user_name=post_data['user_name'],
            cnt_md=tornado.escape.xhtml_escape(post_data['cnt_md'][0]),
            time_update=tools.timestamp(),
            view_count=1,
        )
        return (entry.uid)
Beispiel #5
0
    def insert_data(self, post_data):
        title = post_data['title'][0]
        uu = self.get_by_wiki(title)
        if uu is None:
            pass
        else:
            return (False)


        cnt_html = tools.markdown2html(post_data['cnt_md'][0])

        entry = CabWiki.create(
            title=post_data['title'][0],
            date=datetime.datetime.now(),
            cnt_html=cnt_html,
            uid=tools.get_uu8d(),
            time_create=tools.timestamp(),
            user_name=post_data['user_name'],
            cnt_md=tornado.escape.xhtml_escape(post_data['cnt_md'][0]),
            time_update=tools.timestamp(),
            view_count=1,
        )
        return (entry.uid)