Decomposition of objects in Emitter is not extensible

Issue #94 new
Matthew Kemp
created an issue

Decomposition of objects in Emitter is not extensible. It would be handy to break out the construct method into a separate objects so that additional decomposition steps could be easily added. For example it would be nice to allow users to add a date/time decomposition.

Comments (2)

  1. Jim Sizelove

    I second this request to decompose the construct() method of the Emitter into a separate class. I had to copy the django-piston code into my project in order to vary the names of the <resource> elements in the XML representations.

  2. Anonymous

    Jim, that's one of the use cases I have as well. The other main use case is that I want to be able to emit CSV which is flat compared to structured formats like JSON and XML. For CSV I'd like to override how foreign keys are handled so that it returns a str() or repr() of the object instead of decomposing it. However, to implement this functionality now I'd have to override the entire construct function to change a couple lines.

  3. Log in to comment