﻿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	ORM: 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. ''<refrerenced_obj>''_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
}}}
"	Bug	new	Database layer (models, ORM)	2.0	Normal		ORM, ForeignKey, NOT NULL constraint, inconsistency		Unreviewed	0	0	0	0	0	0
