Ticket #10808: base.py.diff
File base.py.diff, 1.3 KB (added by , 15 years ago) |
---|
-
base.py
273 273 # Now we're left with the unprocessed fields that *must* come from 274 274 # keywords, or default. 275 275 276 # We're creating a set to keep track of which fields have already 277 # been assigned values. In the case of diamond inheritance, where 278 # B and C inherit from A, and D inherits from B and C, D will have 279 # "redundant" copies of each of A's fields. As we iterate through 280 # all the fields, the second time we see a field we run the risk of 281 # reassigning it the default value, so if a field has already been 282 # seen in set_fields, we ignore it. 283 set_fields = set() 276 284 for field in fields_iter: 285 if field.attname in set_fields: 286 continue 277 287 is_related_object = False 278 288 # This slightly odd construct is so that we can access any 279 289 # data-descriptor object (DeferredAttribute) without triggering its … … 311 321 setattr(self, field.name, rel_obj) 312 322 else: 313 323 setattr(self, field.attname, val) 324 set_fields.add(field.attname) 314 325 315 326 if kwargs: 316 327 for prop in kwargs.keys():