El 03/10/13 18:13, Ed Leafe escribió:
On Oct 3, 2013, at 3:53 PM, Ricardo Aráoz <ricar...@gmail.com> wrote:

This works ok as far as that when I drag and drop a picture into the dImage the 
control will show the dropped picture. But it will not be persisted in the db. 
I mean, before committing I change any other field then go to the next record, 
come back and I'll see the change I made, but with the dImage when I come back 
I still see the old picture. What am I doing wrong here?
Data is persisted through the Value property. What happens if you set that to 
the contents of the dropped file?



It sort of works.
Replaced self.Foto.Picture = filelist[0] with self.Foto.Value = filelist[0]
The dropped image is taken and is persisted but the following message appears as soon as I drop the image:

/usr/local/lib/python2.7/dist-packages/Dabo-0.9.13-py2.7.egg/dabo/ui/uiwx/dImage.py:362: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
if self._imageData == val:

And when I close the form and asks me if I want to save the changes I answer Yes and :

âˆë«•Æ™åJ)ÛG©¢“Œï¹‰ÿÙ
0
1
invalid start byte
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/Dabo-0.9.13-py2.7.egg/dabo/ui/uiwx/dFormMixin.py", line 151, in __onWxClose
self.raiseEvent(dEvents.Close, evt)
File "/usr/local/lib/python2.7/dist-packages/Dabo-0.9.13-py2.7.egg/dabo/ui/uiwx/dPemMixin.py", line 1084, in raiseEvent
super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/Dabo-0.9.13-py2.7.egg/dabo/lib/eventMixin.py", line 81, in raiseEvent
bindingFunction(event)
File "/usr/local/lib/python2.7/dist-packages/Dabo-0.9.13-py2.7.egg/dabo/ui/uiwx/dFormMixin.py", line 260, in __onClose
if self._beforeClose(evt) == False:
File "/usr/local/lib/python2.7/dist-packages/Dabo-0.9.13-py2.7.egg/dabo/ui/uiwx/dForm.py", line 72, in _beforeClose
ret = self.confirmChanges()
File "/usr/local/lib/python2.7/dist-packages/Dabo-0.9.13-py2.7.egg/dabo/ui/uiwx/dForm.py", line 164, in confirmChanges
self.save(dataSource=biz.DataSource)
File "/usr/local/lib/python2.7/dist-packages/Dabo-0.9.13-py2.7.egg/dabo/ui/uiwx/dForm.py", line 414, in save
bizobj.saveAll(saveTheChildren=self.SaveChildren)
File "/usr/local/lib/python2.7/dist-packages/Dabo-0.9.13-py2.7.egg/dabo/biz/dBizobj.py", line 493, in saveAll
saveTheChildren=saveTheChildren, scanRequeryChildren=False)
File "/usr/local/lib/python2.7/dist-packages/Dabo-0.9.13-py2.7.egg/dabo/biz/dBizobj.py", line 969, in scanKeys
ret = func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/Dabo-0.9.13-py2.7.egg/dabo/biz/dBizobj.py", line 560, in save
cursor.save(includeNewUnchanged=True)
File "/usr/local/lib/python2.7/dist-packages/Dabo-0.9.13-py2.7.egg/dabo/db/dCursorMixin.py", line 1611, in save
saverow(row)
File "/usr/local/lib/python2.7/dist-packages/Dabo-0.9.13-py2.7.egg/dabo/db/dCursorMixin.py", line 1575, in saverow
self.__saverow(row)
File "/usr/local/lib/python2.7/dist-packages/Dabo-0.9.13-py2.7.egg/dabo/db/dCursorMixin.py", line 1686, in __saverow
res = aux.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/Dabo-0.9.13-py2.7.egg/dabo/db/dCursorMixin.py", line 363, in execute
self._dblogExecute("execute() FAILED", sql, params)
File "/usr/local/lib/python2.7/dist-packages/Dabo-0.9.13-py2.7.egg/dabo/db/dCursorMixin.py", line 328, in _dblogExecute
logmsg = "%s SQL: %s, PARAMS: %s" % (msg, sql, params)
File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position 0: invalid start byte

I think I have to get the image first or something, I'll keep at it.
Thanks

_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/524de2a4.4000...@gmail.com

Reply via email to