-
-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix XML renderer for snapshots (used when previewing with Enketo) #2035
Conversation
…pi into 2029-snapshot-xml-renderer
…default XML renderer class, removed AssetSnapshotXFormRenderer
…endMixin.list instead
kpi/deployment_backends/mixin.py
Outdated
@@ -145,10 +145,11 @@ def _requests_response_to_django_response(requests_response): | |||
django_response.write(requests_response.content) | |||
return django_response | |||
|
|||
|
|||
#@renderer_classes((JSONRenderer, XMLRenderer)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this for? Is it a TODO
for the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it was! But I changed my mind since I pushed this commit and I will do it another way
kpi/deployment_backends/mixin.py
Outdated
def list(self, kpi_request, *args, **kwargs): | ||
return self.retrieve(kpi_request, None, *args, **kwargs) | ||
|
||
#@renderer_classes((JSONRenderer, XMLRenderer)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same answer as above :-)
kpi/renderers.py
Outdated
@@ -49,4 +59,4 @@ class XlsRenderer(renderers.BaseRenderer): | |||
def render(self, data, media_type=None, renderer_context=None): | |||
asset = renderer_context['view'].get_object() | |||
return asset.to_xls_io(versioned=self.versioned, | |||
kobo_specific_types=self.kobo_specific_types) | |||
kobo_specific_types=self.kobo_specific_types) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our editors love to fight each other about this.
https://www.reddit.com/r/Python/comments/1zjugg/question_why_does_pep8_recommend_leaving_a_blank/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…a future purpose, but not needed anymore
@jnm, I finally kept
DEFAULT_RENDERER_CLASSES
in settings.I just removed
rest_framework_xml.renderers.XMLRenderer
and used an extended class of it.This class now replaces
AssetSnapShotRenderer
where it was called. EvenXFormRenderer
is based on it.Fixes #2029