Re: [SQLObject] Binary support (BLOB columns)
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Hong Y. <hon...@ho...> - 2005-01-14 14:18:04
|
Oleg Broytmann wrote: > > I cannot find a portable way to escape the binary value. In both >Postgres (psycopg) and MySQLdb Binary() and BINARY are equal to >strings... well, in Postgres Binary() returns a buffer... not a big >deal. > > > I think the buffer thing could be more troublesome. Modifying your test a little bit: .... prof2 = Profile.get(iid) self.assertEqual(prof2.image, data) + prof2.set(image = data) # or prof.image = data + self.assertEqual(prof2.image, data) .... And you get an AssertionError, something like: AssertionError: <buffer object at 0x0090D1E0> != '\0\b\t\n.....' So after an set method the BLOB field is returned as a buffer object when accessed. Doesn't seem good. The test is run under psycopg. Hong Yuan |