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 5826,Can't recover GenericForeignKey content type and object id field names,kgoudeaux,nobody,"The !GenericForeignKey class is perfect for recovering the object it references but leaves no way to recover ''itself'' and the field names it stores. Its __get__ function only returns the object it references or an error.[[BR]] !DoesNotExist when it isn't set on an instance.[[BR]] !AttributeError when accessed from the model class.[[BR]] This one line patch and doc test changes the behavior of __get__ to return the GenericForeignKey instance when accessed from the model class thereby allowing access to the content type and primary key field names.",,closed,Contrib apps,dev,,fixed,ContentType GenericForeignKey generic relations,koen.biermans@…,Design decision needed,1,0,0,0,0,0