| 658 | # MultiValueDictResolver |
| 659 | # ======================================================================================================================= |
| 660 | class MultiValueDictResolver(DictResolver): |
| 661 | def resolve(self, dct, key): |
| 662 | if key in (GENERATED_LEN_ATTR_NAME, TOO_LARGE_ATTR): |
| 663 | return None |
| 664 | |
| 665 | # ok, we have to iterate over the items to find the one that matches the id, because that's the only way |
| 666 | # to actually find the reference from the string we have before. |
| 667 | expected_id = int(key.split("(")[-1][:-1]) |
| 668 | for key in list(dct.keys()): |
| 669 | val = dct.getlist(key) |
| 670 | if id(key) == expected_id: |
| 671 | return val |
| 672 | |
| 673 | raise UnableToResolveVariableException() |
| 674 | |
| 675 | |
| 676 | # ======================================================================================================================= |