mail.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:idealoom 作者: conversence 项目源码 文件源码
def reprocess_content(self):
        """ Allows re-parsing all content as if it were imported for the first time
            but without re-hitting the source, or changing the object ids.
            Call when a code change would change the representation in the database
            """
        session = self.db
        emails = session.query(Email).filter(
                Email.source_id == self.id,
                ).options(joinedload_all(Email.parent))
        for email in emails:
            #session = self.db
            #session.add(email)
            blob = email.imported_blob
            if not isinstance(blob, native_str):
                blob = blob.decode('ascii')
            (email_object, dummy, error) = self.parse_email(blob, email)
            #session.add(email_object)
            session.commit()
            #session.remove()

        with transaction.manager:
            self.thread_mails(emails)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号