-
Notifications
You must be signed in to change notification settings - Fork 4
Expand CSV download to methodology and information pages #471
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
base: main
Are you sure you want to change the base?
Conversation
| from cms.core.custom_date_format import ons_date_format | ||
|
|
||
| # Re-exports for backwards compatibility | ||
| from cms.core.utils import create_data_csv_download_response_from_data, sanitize_data_for_csv |
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.
question: is this really needed?
| from wagtail.coreutils import WAGTAIL_APPEND_SLASH | ||
|
|
||
| from cms.core.utils import create_data_csv_download_response_from_data, flatten_table_data | ||
| from cms.datavis.constants import CHART_BLOCK_TYPES, TABLE_BLOCK_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.
I know we have a bit of cross-polination here, but seeing this makes me think we're cramming too much in core.
Could this live in its own app data_downloads or something like that? (naming is hard, especially on a Friday afternoon!)
| ) | ||
|
|
||
| # Block type names for table blocks in SectionContentBlock | ||
| TABLE_BLOCK_TYPES: frozenset[str] = frozenset( |
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.
question: should this leave in core blocks? locality of behaviour and all that (ref: SectionContentBlock)
What is the context of this PR?
This PR addresses tickets CMS-972 and CMS-973, and adds support for downloading CSV files from tables and charts from methodology pages, and tables from information pages.
The change involves moving code into a mixin, which we then apply across page models.
The admin URLs have been updated to a more generic structure.
How to review
Follow-up Actions
N/A