#NEWLINE# def gfk2lookup( gfk , obj , **kw ) : #NEWLINE# #INDENT# 'Return a `dict` with the lookup keywords for the given\n    GenericForeignKey field `gfk` on the given database object `obj`.\n\n    ' #NEWLINE# if ( obj is None ) : #NEWLINE# #INDENT# kw [ gfk . ct_field ] = None #NEWLINE# kw [ gfk . fk_field ] = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ct = ContentType . objects . get_for_model ( obj . __class__ ) #NEWLINE# kw [ gfk . ct_field ] = ct #NEWLINE# kw [ gfk . fk_field ] = obj . pk #NEWLINE# #UNINDENT# return kw