Ticket #5031: kwargsPop.diff
File kwargsPop.diff, 931 bytes (added by , 17 years ago) |
---|
-
base.py
136 136 # Assume object instance was passed in. 137 137 rel_obj = kwargs.pop(field.name) 138 138 except KeyError: 139 try: 140 # Object instance wasn't passed in -- must be an ID. 141 val = kwargs.pop(field.attname) 142 except KeyError: 143 val = field.get_default() 139 # Object instance wasn't passed in -- must be an ID. 140 val = kwargs.pop(field.attname, field.get_default()) 144 141 else: 145 142 # Object instance was passed in. Special case: You can 146 143 # pass in "None" for related objects if it's allowed.