Closed jhrr closed 4 years ago
@jhrr I've approved this PR; I think there are definitely more conversations to be had to help shape the "library" use case and improving our URN toolset as you've alluded to (have a URN.py and URN.js card in Trello that I've linked your PR body to as a TODO)
@jacobwegner yep I agree, the space around this is definitely opening up but I also feel there is still lots of refinement to be made. Thanks for the review!
dump_tree
serializer on theNode
model that allows us to slice into the tree arbitrarily and send it to the frontend in order to visualize tree data when standing outside of a single text. As we move into dealing with more library/metaURN
paths, generalising this seemed the right way to go.up_to
element of theURN
API when resolving trees.TreeNode
and resolver logic to the schema. As the query of this data type is not strictly tied to a Django model I've implemented this in the simplest way I could find (viaObjectType
) and I suspect @jacobwegner will have a better idea about if we need to rationalise the approach and how to do that.Node
from its correspondingURN
. Cache the lookup on the instance.Notes
As a result of the first point above (dealing with more library-side/meta
URN
values) I've noticed ourURN.py
andURN.js
utilities are lagging behind a bit and neither can parse a 'partial'URN
likeurn:cts:greekLit:
, for example. This was fine up to now as we were only really dealing with full passageURN
s, but as we move further up the tree the implementations are starting to fail. The JavaScript version is particularly in need of some attention and it would be good if we implemented an analogous method asup_to
in there. I looked into fixing this up during the week but considering time demands it was larger of a job than I wanted to add to my plate and it would be nice to do it properly. I have an entire checklist of variousURN
abstraction related points that I'd like to make into a ticket, and as I mentioned to @jtauber maybe these could be done alongside theCTS URN
widget, which still needs to be ported.Related PRs