Support transforms, fixes #28
This commit is contained in:
parent
36cbd4e417
commit
70eece9e77
@ -3,5 +3,7 @@
|
||||
*The changelog has only been started with version 0.3.12, previous
|
||||
changes must be reconstructed from revision history.*
|
||||
|
||||
* 0.3.13: Fixed logging, added support for transformations on result
|
||||
rows to support slug generation in output (#28).
|
||||
* 0.3.12: Makes table primary key's types and names configurable, fixing
|
||||
#19. Contributed by @dnatag.
|
||||
|
||||
@ -68,7 +68,12 @@ class Serializer(object):
|
||||
|
||||
def serialize(self):
|
||||
self.init()
|
||||
transforms = self.export.get('transform', {})
|
||||
for row in self.query:
|
||||
|
||||
for field, operation in transforms.items():
|
||||
row[field] = OPERATIONS.get(operation)(row.get(field))
|
||||
|
||||
self.write(self.file_name(row), row)
|
||||
self.close()
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user