Skip to content

Support exporting borrowed series#2

Open
h4l wants to merge 8 commits intoCUL-DigitalServices:trunkfrom
ucamhal:gh-export-cmds
Open

Support exporting borrowed series#2
h4l wants to merge 8 commits intoCUL-DigitalServices:trunkfrom
ucamhal:gh-export-cmds

Conversation

@h4l
Copy link

@h4l h4l commented May 27, 2015

This PR adds the grasshopper manage commands to export Timetable data for use in grasshopper.

The exportevents manage command which grasshopper_export_data was 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 the exportevents command to export borrowed series fully. grasshopper_export_data has been modified to extend exportevents and so inherit the fixed borrowed series handling.

A small dataset has been added at fixtures/representative which 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

h4l and others added 8 commits May 10, 2015 23:01
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant