load into richtextctrl from db

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

load into richtextctrl from db

This post has NOT been accepted by the mailing list yet.
the following loads contents of richtextctrl (text) into db, when I query db it looks correct.

            out = BytesIO()
            handler = wx.richtext.RichTextXMLHandler()
            rt_buffer = self.text.GetBuffer()
            handler.SaveFile(rt_buffer, out)
            self.xml_content = out.getvalue()
            cx.execute("insert into notes (key, data) values (?, ?)", (key, self.xml_content))

question how do I get it back from db and load  into richtextctrl

thanks, Dennis