Ticket #3765: patch.2.diff
File patch.2.diff, 1.7 KB (added by , 18 years ago) |
---|
-
django/db/models/manipulators.py
130 130 rel_manager.add(f.rel.to._default_manager.get(pk=n)) 131 131 # TODO: Add to 'fields_changed' 132 132 133 expanded_data = DotExpandedDict( dict(new_data))133 expanded_data = DotExpandedDict(new_data.todict()) 134 134 # Save many-to-one objects. Example: Add the Choice objects for a Poll. 135 135 for related in self.opts.get_all_related_objects(): 136 136 # Create obj_list, which is a DotExpandedDict such as this: -
django/utils/datastructures.py
232 232 raise ValueError, "MultiValueDict.update() takes either a MultiValueDict or dictionary" 233 233 for key, value in kwargs.iteritems(): 234 234 self.setlistdefault(key, []).append(value) 235 236 from sys import version_info 237 major, minor = version_info[0], version_info[1] 238 if major==2 and minor>4: 239 def todict(self): 240 return dict(self.lists()) 241 else: 242 def todict(self): 243 return dict(self) 244 del(version_info, major, minor) 245 todict.__doc__ = """Returns MultiValueDict as dictionary 246 247 >>>MultiValueDict(a=[1,2,3]).todict() 248 {'a': [1,2,3]} 249 """ 250 251 235 252 236 253 class DotExpandedDict(dict): 237 254 """