1789 | | if f.rel.raw_id_admin: |
1790 | | new_vals = new_data.get(f.name, ()) |
1791 | | else: |
1792 | | new_vals = new_data.getlist(f.name) |
| 1789 | new_vals = [] |
| 1790 | lt = type([]) |
| 1791 | # Retrieve the data |
| 1792 | try: |
| 1793 | data = dict.__getitem__(new_data, f.name) |
| 1794 | except: |
| 1795 | data = [] |
| 1796 | if type(data) == lt and len(data) == 1 and type(data[0]) == lt: |
| 1797 | data = data[0] |
| 1798 | # Here we build new_vals depending if the items are just |
| 1799 | # strings or sequences of values |
| 1800 | for item in data: |
| 1801 | if type(item) == lt: |
| 1802 | new_vals.append(item[0]) |
| 1803 | else: |
| 1804 | new_vals.append(item) |