id,summary,reporter,owner,description,type,status,component,version,severity,resolution,keywords,cc,stage,has_patch,needs_docs,needs_tests,needs_better_patch,easy,ui_ux 30537,ForeignKey: inconsistent handling of referenced obj. id.,Aliaksei,nobody,"In short: if referenced obj. is saved after attaching to a referencing obj. its id field (i.e. ''''_id) there remains None. In details: {{{ class ReferencedObj(Model): ... class ReferencingObj(Model): referenced_obj = ForeignKey(ReferencedObj) ... x = ReferencedObj() y = ReferencingObj() y.referenced_obj = x x.save() y.save() -----→ NOT NULL constraint failed: ..._referencingobj.referenced_obj_id }}} Thats happens because **referenced_obj_id** field is not bound to the underlying **referenced_obj.id**",Bug,closed,"Database layer (models, ORM)",2.0,Normal,duplicate,"ORM, ForeignKey, NOT NULL constraint, inconsistency",,Unreviewed,0,0,0,0,0,0