collective / collective.excelexport

Export dexterity contents in an excel file, one column by field
3 stars 9 forks source link

View exposes method that creates data buffer from sheet data #5

Closed tdesvenain closed 7 years ago

tdesvenain commented 7 years ago

Removes some code duplication Makes it easier to programmatically create export file data

tdesvenain commented 7 years ago

@vincentfretin @ebrehault @cedricmessiant Can you review this please ?

vincentfretin commented 7 years ago

You didn't seem to have changed the api so I guess you can merge.

tdesvenain commented 7 years ago

right

2017-01-17 10:10 GMT+01:00 Vincent Fretin notifications@github.com:

@vincentfretin commented on this pull request.

In src/collective/excelexport/view.py https://github.com/collective/collective.excelexport/pull/5:

@@ -140,17 +146,15 @@ def _format_render(self, render): elif not isinstance(render, unicode): render = unicode(render)

  • return render.encode(encoding=self.encoding)
  • try:
  • return render.encode(encoding=self.encoding)
  • except UnicodeEncodeError:
  • try default encoding

ok, maybe you should be explicit and try render.encode(encoding="utf-8") as fallback instead of str(render) which normally is an ascii encoding unless you changed sys.setdefaultencoding?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/collective/collective.excelexport/pull/5, or mute the thread https://github.com/notifications/unsubscribe-auth/AAU395pIrU9myd0Nfl3I_Lwyr2TJ0ZzEks5rTIWDgaJpZM4LFKOE .

-- Thomas Desvenain

Téléphone : 09 51 37 35 18