Open girogiro opened 9 years ago
Sorry about this, and for wasting some hours of your time. As I wrote in #460, we want to replace this with an order field so that the database will remember the Akoma Ntoso import order of speeches/sections and display them in that order, not trying to be clever, as it just causes problems such as you note and isn't worth it.
Assume the following section structure:
and some speeches in each sitting.
Section.get_descendants_tree()
transforms it to:because of earliest speech dates. There are some bugs related to displaying it:
When rendering template
section_detail.html
, the linecauses error
because of empty result from
Section.get_path()
.Also the copy of session 1 is considered a leaf node because of no
children
attribute (although it actually has children) and it tries to show speech count in parentheses.Those two issues can be cured by copying also the
id
attribute to the section copy. (I am not sure if this can cause some unwanted side-effects.)Furthermore, the copy of session 1 has no
speech_min
attribute, so it is moved to the very end of the page bySection._interleave_speeches()
.A line
is needed just behind creation of the section copy in
Section.get_descendants_tree()
.Those simple findings took some hours of my life.
Footnote: I would prefer to show the above section structure in its original form without splitting the session 1, but I think there is no simple way to get it. SayIt just handles it differently.