On Wednesday 28 October 2009 04:11:14 pm Paul McNett wrote:
> John wrote:
> > On Wednesday 28 October 2009 03:20:29 pm Paul McNett wrote:
> >> John wrote:
> >>> On Wednesday 28 October 2009 02:59:27 pm Paul McNett wrote:
> >>>> Just a quick check: is the field defined as a BLOB in your
> >>>> datastructure? (Type L for bLob).
> >>>
> >>> I tried both 'Text' and 'bytea' (large Binary).  No success.
> >>
> >> I'll ask again: what is the contents of biz.DataStructure? Do you see a
> >> datatype code of "L" for the binary field?
> >>
> >> Paul
> >
> > Sorry about that - I immediately thought about what dbPostgres sets the
> > columns too.  I missed the point yes it's 'L' for the binary as reported
> > by bizobj.DataSource.  But we have attempted both 'M' and 'L'.  Larry
> > tried all day to use binary tools (using 'L' for the column).  I tried
> > using string tools (using 'M' for the column).   In the end Larry tried
> > both.
> >
> > Maybe we just haven't come up with the right combination.
>
> Well, I've racked my brain and I don't think I've ever stored binary stuff
> in a database, so I can't say for certain that it works.
>
> Paul

I just realized that I have not actually provided the traceback.  As you can 
see I'm just attempting an save (update).  I'm saving to a Dabo "L" column - 
and a postgres column type 'bytea' (binary).

The steps I'm using.

I have a file that was created using img2py.py.  

newdata = my_images.jflogosmall.GetData()
# type(newdata) = str
pic = dabo.ui.imageFromData(newdata)
#type(pic) = wx._core.Image
self.Logo.Picture = pic # this work fine
self.PrimaryBizobj.setFieldVal('sys_company_logo1', newdata)
now a simple Form.save()

If I attempt to save the 'pic' as in

self.PrimaryBizobj.setFieldVal('sys_company_logo1', pic)

Then Dabo asks  escQuote() to process the data which of course is wrong.

I don't know what I'm doing wrong?


Traceback (most recent call last):
  File "/home/johnf/dabo/dabo/ui/uiwx/dControlMixin.py", line 27, in _onWxHit
    self.raiseEvent(dEvents.Hit, evt, *args, **kwargs)
  File "/home/johnf/dabo/dabo/ui/uiwx/dPemMixin.py", line 952, in raiseEvent
    super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, *args, 
**kwargs)
  File "/home/johnf/dabo/dabo/lib/eventMixin.py", line 93, in raiseEvent
    bindingFunction(event)
  File "/home/johnf/pyProject/court_ordered/SystemClasses.py", line 339, in 
onSave
    self.Form.save()
  File "/home/johnf/dabo/dabo/ui/uiwx/dForm.py", line 383, in save
    bizobj.saveAll()
  File "/home/johnf/dabo/dabo/biz/dBizobj.py", line 361, in saveAll
    startTransaction=False)
  File "/home/johnf/dabo/dabo/biz/dBizobj.py", line 786, in scanChangedRows
    func(*args, **kwargs)
  File "/home/johnf/dabo/dabo/biz/dBizobj.py", line 419, in save
    cursor.save()
  File "/home/johnf/dabo/dabo/db/dCursorMixin.py", line 1310, in save
    saverow(self.RowNumber)
  File "/home/johnf/dabo/dabo/db/dCursorMixin.py", line 1277, in saverow
    self.__saverow(row)
  File "/home/johnf/dabo/dabo/db/dCursorMixin.py", line 1376, in __saverow
    updClause, pkWhere)
UnicodeDecodeError: 'ascii' codec can't decode byte 0x89 in position 23: 
ordinal not in range(128)

Johnf





_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to