Ticket #12819: 12307-onetoone-null.patch
File 12307-onetoone-null.patch, 639 bytes (added by , 15 years ago) |
---|
-
django/db/models/query.py
1202 1202 # If the base object exists, populate the 1203 1203 # descriptor cache 1204 1204 setattr(obj, f.get_cache_name(), rel_obj) 1205 if f.unique :1205 if f.unique and rel_obj is not None: 1206 1206 # If the field is unique, populate the 1207 1207 # reverse descriptor cache on the related object 1208 1208 setattr(rel_obj, f.related.get_cache_name(), obj)