Re: Storing objects in relational database

2008-05-24 Thread bukzor
On May 23, 7:00 pm, alex23 [EMAIL PROTECTED] wrote: On May 24, 7:14 am, nayden [EMAIL PROTECTED] wrote: the execution fails just after the print statement, and I am not quite sure why is that. It's often helpful to include the traceback, or at the very least the last 3-4 lines of it, as

Re: Storing objects in relational database

2008-05-24 Thread Ville M. Vainio
[EMAIL PROTECTED] [EMAIL PROTECTED] writes: I don't know if you'd label it 'elegant', but as far as I'm concerned, storing serialized objects as blobs in a relational database is mostly non-sense. If I use a relational database, it's because it is a *relational* database. If you want an

Re: Storing objects in relational database

2008-05-24 Thread Piotr Chamera
[EMAIL PROTECTED] pisze: I don't know if you'd label it 'elegant', but as far as I'm concerned, storing serialized objects as blobs in a relational database is mostly non-sense. If I use a relational database, it's because it is a *relational* database. If you want an OODB, then we have the

Storing objects in relational database

2008-05-23 Thread nayden
I started playing with python a few weeks ago after a number of years of perl programming and I can say that my first impression is, unsurprisingly, quite positive. ;) The reason I am writing here is that I can't seem to figure out how to save/restore python objects into a relational database.

Re: Storing objects in relational database

2008-05-23 Thread nayden
and then I try to restore the object with the following code def success(rv): print success str = cStringIO.StringIO(libpq.PgUnQuoteBytea(rv[0][0])) i = cPickle.load(str) i.toString() the execution fails just after the print statement, and I am not quite sure why is that. I

Re: Storing objects in relational database

2008-05-23 Thread [EMAIL PROTECTED]
On 23 mai, 23:14, nayden [EMAIL PROTECTED] wrote: and then I try to restore the object with the following code def success(rv): print success str = cStringIO.StringIO(libpq.PgUnQuoteBytea(rv[0][0])) i = cPickle.load(str) i.toString() the execution fails just after the

Re: Storing objects in relational database

2008-05-23 Thread alex23
On May 24, 7:14 am, nayden [EMAIL PROTECTED] wrote: the execution fails just after the print statement, and I am not quite sure why is that. It's often helpful to include the traceback, or at the very least the last 3-4 lines of it, as it helps everyone work out the issue you're having. If

Re: Storing objects in relational database

2008-05-23 Thread Jerry Hill
On Fri, May 23, 2008 at 5:07 PM, nayden [EMAIL PROTECTED] wrote: The reason I am writing here is that I can't seem to figure out how to save/restore python objects into a relational database. Here's a basic version using the sqlite bindings included with Python 2.5: import sqlite3, pickle