The HTTP GET request string is an ordered sequence of key / value pairs:
?spam=eggs&spam=ham&foo=bar
It is, with certain semantics, equivalent to the following dictionary:
{'spam': ['eggs', 'ham'], 'foo': bar}
This works well for the logical properties of the requested page:
?expand=1&expand=2&highlight=7&highlight=9
{'expand': [1, 2], 'highlight': [7, 9]}
If you want to stop expanding the element with id 2, just pull it out of the value expandand enter the query string again. However, if you have a more modal property (with 3+ options), you really want to represent the structure as follows:
{'highlight_mode': {7: 'blue', 9: 'yellow'}}
If the values of the corresponding identification keys are part of a known enumeration. What is the best way to encode this into a query string? I am thinking of using a sequence of two tuples, for example:
?highlight_mode=(7,blue)&highlight_mode=(9,yellow)
: , . , , - , . !