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

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]
You replaced the Value with the file path, not the contents. Try this:

self.Foto.Value = open(filelist[0], "rb").read()


Thanks Ed, that almost did it. Now this part works as it should.
The picture persists as I go next and back. But when I exit the form it asks me if I want to save changes, answer yes and now I think I hit a bug, no decoding should be taking place here as it's binary info :

¯rW<œzÑEjÄ==žÚ8¯]€ÉBqšÀÔ2³g’sE-ÌÙDž
9ÏZŒ¶Ó•ÅSÑ~êo{‚â%s*ýëÑíT,!@HèFqEåbRŒ´=ür§©';O8ÍQ¹QóãŽ:v¢Šç“Ñ3¶Æ5Ï$®+û;ÅV°Úç%„ôxPCáë[¤ûÆÈ?Jµi,)'W`7®h¢½|<o´>áÎ3‚3Š€¨$ŸAEØY9
Op8©S|Ãyl{ElˆŽ¬ÿÙ
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

_______________________________________________
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/524e26cd.7040...@gmail.com

Reply via email to