Support exporting borrowed series#2
Open
h4l wants to merge 8 commits intoCUL-DigitalServices:trunkfrom
Open
Conversation
Although it wasn't an official feature, people have sometimes linked series to more than one "home" module as a form of borrowing. The series traverser now supports traversing all parent modules using walk_parents().
Events are output once for each module their series is linked to.
It now overrides most functionality from exportcsv which now has borrowed series support.
This can be used to test the behaviour of CSV exporting commands like grasshopper_export_data and the program from fronteerio/grasshopper which generates a tree from the CSV export.
There's a disabled part with events and a URL, one with a URL and one without a URL.
Traversal was throwing the wrong type of exception in response to invalid structure.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the grasshopper manage commands to export Timetable data for use in grasshopper.
The
exporteventsmanage command whichgrasshopper_export_datawas based on did not support exporting borrowed series fully. (A series referenced from > 1 module would only have one of the referencing modules exported.) I've patched theexporteventscommand to export borrowed series fully.grasshopper_export_datahas been modified to extendexporteventsand so inherit the fixed borrowed series handling.A small dataset has been added at
fixtures/representativewhich includes Timetable db data and expected outputs for its grasshopper CSV export and JSON tree representation.Note that this PR contains the changes from #1