Add support for PDF and CSV Export#236
Conversation
LGraber
left a comment
There was a problem hiding this comment.
Generally, I think this points out some flaws in our current "populate" model because it basically breaks the idea that a model is just a property bag. By storing the function and executing a call to the server, we have kind of broken the implied contract. Having said that, it appears we have done that elsewhere now. I think we will need to take a look at this in the not so distant future to get this back to a clean and well expressed state ... even if that means we separate the low level entities from the objects which can be used to logically group them
|
Thanks! Yeah, I agree we need to revisit the model-call-sync problems (tags still feel weird to me). This PR has more work, so stay tuned for the updates. PS, I can't wait for options-builder, these PDF options are long |
|
RE: data vs. csv - At some point we want to support json output. Would you see that as being a "json" endpoint also? RE: type/outputSize - PageSize would fit the domain of pdf better than outputSize. RE: Iterable Stream - for csv it makes sense(ish), but does pdf really make sense to be iterable? What's the use case? pdfs will generally be small enough since we are only doing one sheet/dashboard at a time. |
|
re: json -- yeah, I think I slightly prefer that to something like re: pageSize -> But we use that for the regular request options. I don't like it meaning 1-1000 on one and 'Letter' on another :P Any other ideas? re: iterables -> It could technically be a 10000 by 100000 pixel dashboard with 1 billion marks. If we're not worried about that I can keep it simple and leave it as is. I agree it's very much an edge case and just paranoia. |
test/assets/file_upload.xml
Outdated
| @@ -0,0 +1,5 @@ | |||
| <?xml version='1.0' encoding='UTF-8'?> | |||
There was a problem hiding this comment.
er, this was to cover your other item but I mixed my CLs. Ignore for now.
| raise UnpopulatedPropertyError(error) | ||
| return self._pdf() | ||
|
|
||
| @property |
There was a problem hiding this comment.
Man, this pattern is screaming for a decorator or something.
TODO:
imagetopng?/cc @RussTheAerialist