How can I rearrange taxonomy weights for terms with two-deep hierarchies? I have a taxonomy vocabulary on my site of user ages.

It looks like this:



However, I want to change the weight so that 20s is -19, Late Teens is -18, Early 20s is -17, etc.  In other words, I want to change the weight so that when I sort by weight in Views, the terms appear in exactly the same order as shown on the screen above.

However, when I manually adjust the weights to -19, -18, -17, etc., upon saving the list of terms the weights are reverted to those listed above.

I tried individually dragging and dropping each term to change the order, but again when I saved the list, the weights had returned to this pattern:


Parent A 0
A Child A 0
A Child B 1
A Child C 2
A Child D 3
Parent B 1
B Child A 0
B Child B 1
B Child C 2
Parent C 2
Parent D 3


etc.

However, when sorting by weight in Views, this then gives a list like:


Parent A
A Child A
B Child A
C Child A
A Child B
Parent B
B Child B
C Child B
A Child C
B Child C
Parent C
C Child C


which looks terrible and makes no sense.

How can I manually control the weights and override whatever processing Drupal is applying to them?
For such small taxonomies (large and frequently changing ones will be a pain) you may create special custom field for flat sorting order, since weights are meant to be used on a certain hierarchy level:



Then you just add some sort criteria to your views:



Considering this terms structure:



you will get this output:



Good thing: this requires no code hacking at all, yet supports all Views features like caching.

Bad thing: you will go mad with setting this field values for large vocabularies.